[ Date Index ][
Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]
Thanks Neil
As soon as I renamed it php instead of php3 it worked!
And so I built my first script to access a database called "allusers" with a table called "names" and having the fields "firstname", "lastname", "streetaddr", "distaddr", "city", "county", "postcode", "country".
Here is the script:- <html> <body>
<?php $db=mysql_connect("localhost","root"); mysql_select_db("allusers",$db); $result=mysql_query("SELECT*FROM names",$db); printf("firstname:%<br>\n",mysql_results($result,0,"firstname")); printf("lastname:%<br>\n",mysql_results($result,0,"lastname")); printf("streetaddr:%<br>\n",mysql_results($result,0,"streetaddr")); printf("distaddr:%<br>\n",mysql_results($result,0,"distaddr")); printf("city:%<br>\n",mysql_results($result,0,"city")); printf("county:%<br>\n",mysql_results($result,0,"county")); printf("postcode:%<br>\n",mysql_results($result,0,"postcode")); printf("country:%<br>\n",mysql_results($result,0,"country")); ?>
</body> </html>
It doesn't do what I want it to do. i.e. Display all the records! Here is the output from Mozilla.
Warning: Access denied for user: 'root@xxxxxxxxx' (Using password: NO) in /var/www/html/test.php on line 5
-- The Mailing List for the Devon & Cornwall LUG Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the message body to unsubscribe.