我駕駛自己瘋狂試圖找出我在哪裏搞亂了我的語法錯誤。我已經完成了這個程序100多次,我仍然不知道爲什麼它沒有運行。被調用的數據庫中的所有區域都不是空白的,並且所有變量都從前一頁中正確導入。凡在這個php程序
$host="localhost";
$username="root";
$password="sunbuggy";
$database="mpg";
$table="m";
mysql_connect($host,$username,$password) or die("unable to connect to mysql server");
mysql_select_db($database) or die("Unable to select database");
$driver=$_POST['driver'];
$shuttle=$_POST['shuttle'];
$gas=$_POST['gas'];
$miles=$_POST['miles'];
$cost=$_POST['cost'];
$getlastpri= "(SELECT * FROM '$table' ORDER BY `prikey` DESC)";
$sql=mysql_query($getlastpri);
$i=0;
$num=mysql_result($prime,$i,$prikey);
$shut=NULL;
while ($shut != $shuttle){
$shut=mysql_result($sql,$i,shuttle);
$i++;}
if($shut == $shuttle)
{$pastmiles=mysql_result($sql,$i,miles);}
else
$pastmiles=Null;
if($pastmiles=Null):
{$milestravled=Null;}
else:
$milestravled=$miles-$pastmiles;
$milespergallon=($milestravled/$gas);
$abc= "INSERT INTO $table VALUES ('','$driver','$shuttle','$gas','$miles','$cost', '$milestravled','$milespergallon')";
mysql_query($abc);
mysql_close();
echo "Your latest information has been input into the server";
?>`
非常感謝。亨利
什麼錯誤信息你好嗎?什麼不按預期工作? –