note 30809 deleted from function.mysql-select-db by betz
| From: | betz@php.net | Date: | Sat, 21 Jun 2003 21:37:44 +0000 |
| Subject: | note 30809 deleted from function.mysql-select-db by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-50795@lists.php.net to get a copy of this message | ||
Note Submitter: Oromian@hotmail.com
----
here is my favorite way to do the DB thang. :)
<?
// db variables
// inserts variables accordingly
$host = "";
$user = "";
$pass = "";
$db = "";
$table = "";
// connecting to the db
$link = mysql_connect ($host, $user, $pass);
// the db query
$q = "SELECT * from $table";
$results = mysql_db_query ($db, $q, $link);
// fetching the results
while ($row = mysql_fetch_array($result)){
echo "$row[whatever]<br>$row[whatever2]<br><br>";
}
/*
this is the area you can grab stuff from the db in the manner i did it above
whatever = name of the tables colum
*/
// closing the db link
mysql_close ($link);
?>
i'd be happy to answer some questions about this topic for you newbies our there, just drop me
an email.