| Home > Computer & I'net > WHERE... |
|
|
|||||||||||||
|
|
|||||||||||||
|
||||||||||||||
WHERE | |
$sql = mysql_query("SELECT * FROM table_name WHERE some equation"); while ($row = mysql_fetch_row($sql)) { echo "$row[0] $row[1] $row[2] <br />"; } The query will only pick out the rows that provide a TRUE result according to the WHERE equation. Example... $sql = mysql_query("SELECT * FROM address_book WHERE first_name='David'");
while ($row = mysql_fetch_row($sql)) { echo "$row[0] $row[1] $row[2] <br />"; } The query would search the address_book table and compare all of the data in the first_name column for the specified value. The WHILE loop then prints out the results found. ----------------- Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission. | |
| Articles |
•Auto & Trucks•Business•Computer & I'net·General·Apache·CSS·Database·Hardware·HTML·Javascript&DHTML·LinuxMySQL·Operating System·Perl / CGI·PHP·Programming·Publishing·Search Engines·Software Problems·SSI·Tips & Tricks·Utilities·Web Design•Family•Food & Drink•Gardening•Health•Other•Pets•Psychology•Spiritual•Travel•Women |
| Calculators |
|