<?php
session_start(); 
include "../inc/chec.php";
include "../conn/conn.php";
$t_sqlstr = "select * from chuku where id = ".$_GET[id] or die(mysql_error());
$t_result = mysql_query($t_sqlstr,$conn) or die(mysql_error());
$t_rows = mysql_fetch_row($t_result) or die(mysql_error());
?>
运行错误提示:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

解决方案 »

  1.   

    $t_sqlstr = "select * from chuku where id = " + $_GET[id] or die(mysql_error());
      

  2.   

    提示:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2' at line 1
      

  3.   

    你把$t_sqlstr打印出来,就知道什么原因了。
      

  4.   

        $t_sqlstr = "select * from chuku where id = 0".$_GET[id] or die(mysql_error());