-
PHP & mySQL databases
Hi there :-)
I need to learn how to work PHP w/ mySQL databases. I need to be able to connect and display a table w/ query results.
Im not asking for you to explain everything to me, I just need someone to point me in the right direction, please.
Any info or good tutorial links w/ examples would be greatly appreciated.
Thanks a lot!
-
PHP Code:
<?php
mysql_connect('localhost', 'mysql_user', 'mysql_password') or
die('Could not connect: ' . mysql_error());
mysql_select_db('mydb');
$result = mysql_query('SELECT id, name FROM mytable');
while ($row = mysql_fetch_array($result)) {
echo 'ID: ' . $row['id'] . ' Name: ' . $row['name'] . '<br />';
}
?>
mysql_connect
mysql_error
mysql_select_db
mysql_query
mysql_fetch_array