3 messages in com.mysql.lists.win32AW: sample PHP-MySQL code
FromSent OnAttachments
Tata Respecia22 Jun 2004 22:26 
Gerhard Brauckmann22 Jun 2004 22:51 
Tata Respecia22 Jun 2004 23:45 
Subject:AW: sample PHP-MySQL code
From:Gerhard Brauckmann (gerh@gbrauckmann.de)
Date:06/22/2004 10:51:22 PM
List:com.mysql.lists.win32

tata, here is what you need: <? $host ="your_host_name"; $user ="your_db_user"; $password="your_db_pwd"; $db_name = "your_database_name" mysql_connect($host,$user,$password) or die("can't connect to database");

$my_query = "SELECT * FROM books ORDER by title"; $result = mysql_db_query($db_name, $my_query);

while ($content = mysql_fetch_object ($result)) { $id = $content -> id; $subject = $content -> subject; $title = $content -> title; echo "$id -- $subject -- $title; } ?>

Gerhard

can any body give me a sample php-mysql code for me to start? i have all php and mysql setup correct. i have a table 'books' with fields id,subject and title. i just want the code to display all the records of my 'books' table. thank you very much