(intval(base64_decode($_GET[id])))");  就是附近。。谢谢。<?php
if($_GET[id]){
$sql_1=mysql_query("select * from $tbname_jihua where id =(intval(base64_decode($_GET[id])))");
}else{
$sql=mysql_query("select * from $tbname_jihua");
}
?>

解决方案 »

  1.   

    字符串里包含的变量才被解析,函数名和常量不会被解析
    $id = intval(base64_decode($_GET[id]));
    $sql_1=mysql_query("select * from $tbname_jihua where id = {$id}");// or 
    $sql_1=mysql_query("select * from $tbname_jihua where id = ". intval(base64_decode($_GET[id])) );
      

  2.   

    intval
    base64_decode
    都是php函数,就和上面说的。在字符串里面是无法解析的。
      

  3.   

    类似intval(base64_decode($_GET[id])) 这样的代码
    单独写出来不好么,为什么要写在SQL里呢?因为省地方?$id=intval(base64_decode($_GET[id]));
    $sql_1=mysql_query("select * from $tbname_jihua where id ={$id}");这样不清晰明了,而且你的问题也解决了...