Forum Moderators: coopster
I have recently started learning PHP/SQL techniques.
I am a complete beginner and have recently been on a 3day 1-2-1 course to learn the basics. However, i am having trouble and hope somone can help.
I am basically just trying to pull information from my database. I have a local server on my PC.
I have typed this code within my HTML document:
$db = mysql_connect("localhost","Administrator","password");
mysql_select_db("tuna",$db);
?>
here are the results:
<?php
$result = mysql_query("SELECT firstname FROM brian");
?>
I know the database does work, cause by sheer fluke i got some results up earlier. but didn't save!!! doh!!!
Can someone please tell me how to pull the information ffrom my database please.
regards
webboy
while ($row = mysql_fetch_array($result)) {
print "I have a row $row[firstname]";
}
Will get you started, another useful function
$num = mysql_num_rows($result);
And even more useful,
[php.net...] -- will make you an expert in no time ;) .... good luck.