我試圖運行這個查詢到php,但我無法做到,並且不知道代碼中究竟出了什麼問題。 查詢運行正常,如果我通過phpmyadmin運行它。 請讓我知道它有什麼問題。 感謝運行查詢到php
<?php
$username = "cp";
$password = "aasfadasd";
$hostname = "localhost";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL";
//select a database to work with
$selected = mysql_select_db("smj",$dbhandle)
or die("Could not select examples");
$query = "UPDATE rot_galls JOIN rot_grs SET rot_galls.name = rot_grs.name WHERE(rot_galls.rgroup = rot_grs.id";
$result=mysql_query($query);
mysql_close($dbhandle);
?>
錯字這裏WHERE(rot_galls.rgroup? – 2013-04-28 12:16:26
它總是一個好主意,提供一個錯誤信息,但錯字的事情應該修復它。 – jossif 2013-04-28 12:18:59