שלום! התחלתי ללמוד PHP בעזרת מדריך ונתקלתי בבעיה בחיבור לבסיס הנתונים. זהו הקוד שלי:
PHP קוד:
<html>
<head>
<title>mysql.php</title>
</head>
<body>
<center>
<?
$host=localhost;
$user=discer;
$password=123456;
$db=discer_test;
$con=@mysql_connect($host,$user,$password);
@mysql_select_db($db);
$sqlquery="SELECT * FROM users";
$theresult=@mysql_query($sqlquery,$con);
if (mysql_num_rows($query) == 0)
{
echo ("אין כלום בשורה הזאת.");
}
else
{
while ($recordeset=@mysql_fetch_array($theresult))
{
echo "$recordeset["age"]";
}
}
?>
</center>
</body>
</html>
וזאת השגיאה:
PHP קוד:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/discer/domains/discer.220mb.com/public_html/mysql.php on line 26
אשמח אם תעזרו לי לתקן את זה בבקשה. תודה!