We have 16 guests online
   
PHP Scripts arrow Free PHP Tutorials arrow Free PHP Tutorials 
 
Search
Results 11 - 20 of 30
Display #

11. Basic SELECT query in MySQL
(PHP Tutorials and Examples/PHP)

  1. # fetch field1 and field2 from all rows in myTable
  2. SELECT field1, field2 FROM myTable;
  3.  
  4. # only rows where field1 is greater than 10
  5. SELECT field1, field2 FROM myTable WHERE field1 > 10;
  6.  
  7. # select field1 and the total number of all unique field1s from myTable
  8. SELECT field1, count(field1) AS total FROM myTable GROUP BY field1;
  9.  
  10. # those with a count(field1) equaling 5
  11. SELECT field1, count(field1) AS total FROM myTable GROUP BY field1 HAVING total = 5;

 

16/02/2007 | 1253 Hit(s) | (4 votes)

12. Calculating time of sunrise / sunset for location with date_sunrise / date_sunset
(PHP Tutorials and Examples/PHP)

Built-in function calculates the time of sunset and sunrise with latitude, longitude, zenith, and GMT offset. Added in PHP 5. (Credit: http://www.php.net/manual/en/function.date-sunset.php under ODL1.0)

16/02/2007 | 959 Hit(s) | (0 vote) | Read more...

13. Randomly rotating banner
(PHP Tutorials and Examples/PHP)

Randomly select an image from an array and display it with an <img> tag. Useful as an advertisement rotator. (Credit: apress.com)

16/02/2007 | 1076 Hit(s) | (1 vote) | Read more...

14. Simple form submission with PHP
(PHP Tutorials and Examples/PHP)

This is a script that demonstrates simple form handling in PHP. The script prints a form to the browser that submits to itself. The script checks to see that the "posted" variable was set by the form (meaning the form has been submitted), processes the form information, and prints out a message indicating that the submission was successful.

16/02/2007 | 1427 Hit(s) | (3 votes) | Read more...

15. Get data between 2 elements or tags
(PHP Tutorials and Examples/PHP)

Retrieves data from between 2 specified beginning and ending elements or tags. Could be used to read data out of an xml document.
16/02/2007 | 684 Hit(s) | (1 vote) | Read more...

16. The Basics of multiple pages inside one
(PHP Tutorials and Examples/PHP)

I wasn't really sure what to call this, but I've been doing it forever. So I thought I'd create a little example. This is very basic, it can be expanded too. Below, the p variable will be referring to the current page.

16/02/2007 | 1275 Hit(s) | (2 votes) | Read more...

17. Pagination as seen on Evil Walrus
(PHP Tutorials and Examples/PHP)

This is a striped down version of the code used to generate the tabs in the search results pages. This function returns an array of the page numbers to be displayed. The array keys are ordered as they should be displayed (you could simply cycle through the array with foreach to display the page numbers). It will return a maximum of 15 page numbers, and if there are more than 15 page numbers, it will show the first and/or last 2 page numbers of the results. The array values represent the page number, and array values that are '0' represent where extra page numbers have been truncated.

16/02/2007 | 1437 Hit(s) | (2 votes) | Read more...

18. Using ob_flush to push output to browser
(PHP Tutorials and Examples/PHP)

This script cycles through an array and prints something to the browser for every loop. It sleeps 2 seconds for each loop after pushing the content to the browser. Very useful in some instances, but may not work for all browsers.

 

16/02/2007 | 1308 Hit(s) | (0 vote) | Read more...

19. Cycling through an array of names with foreach
(PHP Tutorials and Examples/PHP)

Using the foreach construct to cycle through an array.

16/02/2007 | 162 Hit(s) | (0 vote) | Read more...

20. Nested functions
(PHP Tutorials and Examples/PHP)

An example of using functions embedded within functions. (Courtesy apress.com)

16/02/2007 | 682 Hit(s) | (0 vote) | Read more...

  
Top

Directory Stats

There are 718 listing and 44 categories in our website

Change Language

Mobile Phones
Mortgage
Encyclopaedia
Loans
Remortgages