This code snippet will allow you to generate pop-up items by querying the
specific table in a database. This is particularly useful if you have data
that grows (for example, if your clients can add information to your tables,
like states they ship to, or job categories, etc.) This way, your .php3
files or HTML won't have to be updated.
<?php
//.
//.
//.
function show_options($db, $tableName)
{
$result = db_query ($db, "SELECT * FROM $tableName");
while (list($id, $name) = db_fetch_row($result))
{
echo "<option value=$id>$name</option>\n";
}
}
//.
//.
//.
?>
<body>
<select name="State">
<?php show_options($dbid, "TABLENAME"); ?>
</select>
</body>
This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases , MySQL , Complete Programs , PHP , Databases Message of the Day - Random Message (Needs MySQL!) Categories : Databases , HTML and PHP , PHP , MySQL Required form fields that pull from MySQL database Categories : PHP , HTML and PHP , Databases , MySQL mySQL/PHP/search with multientry
form and table output with colored rows Categories : PHP , Beginner Guides , MySQL , HTML and PHP , Databases Creating thumbnails from MySQL Blobs online Categories : PHP , MySQL , Graphics , HTML and PHP , Databases Database resultset navigation Categories : PHP , HTML and PHP , Databases , MySQL , Navigation Storing / Retrieving pictures from database This can be used for banner / ads exchange. very useful for people developing big portal with ads in the site........ Categories : PHP , MySQL , Databases , HTML and PHP Function to do live population of HTML's <Select> tag from a Table Categories : PHP , MySQL , HTML and PHP , Databases Functions for loading images into a MySQL database and displaying them. Categories : Graphics , HTML and PHP , MySQL , PHP , Databases Pull Down Surfing - Surf on Change Categories : Java Script , MySQL , HTML and PHP , PHP , Databases Alternating background color for HTML table rows Categories : PHP , Databases , MySQL , HTML and PHP html split bar used to split in multiple pages a database result Categories : HTML and PHP , Databases , MySQL , PHP Record Set Paging with PHP (RSP) Categories : PHP , MySQL , Navigation , Databases , HTML and PHP A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP , PHP Classes , Databases , MySQL , HTML and PHP A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP , Databases , Algorithms , PHP , MySQL
David Keaveny wrote : 383
I hope I don`t need to point this out, but the line that
reads
while (list($id, $name) = $db_fetch_row($result))
should of course read
while (list($id, $name) == $db_fetch_row($result))
since you`re testing for equivalence. Guess who got
caught out by that one :-)