I'm new to php and sql I have a background in C++ though
I typed some code to input data into a mysql database and that works perfectly
but I can't query the database and get it out
here is my code
<html>
<body>
<?php
$db = mysql_connect("localhost", "root","");
mysql_select_db("learndb",$db);
$results = mysql_query("Select * FROM personnel");
$num=mysql_numrows($result);
mysql_close();
echo ($num);
$x = 0;
while ($x < $num){
$first=mysql_result($result,$i,"firstname");
$last=mysql_result($result,$i,"lastname");
$nick=mysql_result($result,$i,"nick");
$email=mysql_result($result,$i,"email");
$salary=mysql_result($result,$i,"salary");
echo ("<b>$first $last</b><br>nick: $nick<br>email: $email<br>Salary: $salary<br><hr><br>");
++x;
}
?>
</body>
</html>
when I go to my broswer and run it I get this error
Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in c:\program files\apache group\apache\htdocs\get1.php on line 18
that's the line that I echo the information out
I'm throughly confused help is very much appreciated