仅从数据库中取值,下面的语法对吗?还有别的语句吗可参考吗? $about=mysql_query("select Content from help where ID=86");
仅从数据库中取值,下面的语法对吗?还有别的语句吗可参考吗? $about=mysql_query("select Content from help where ID=86"); echo $about; //没内容,也无出错提示
在PHP配置文件中有没有开启错误跟踪???
仅从数据库中取值,下面的语法对吗?还有别的语句吗可参考吗? $about=mysql_query("select Content from help where ID=86"); echo $about; //没内容,也无出错提示 -------------------- 当然没有内容了,这里的$about是resource类型的,不会显示出来 要用$rs=mysql_fetch_array($about)来转化成数组才能用print_r打印出来。。
$about=mysql_query("select Content from help where ID=86"); echo $about; //显示结果为:Resource id #7 能否有什么简单的方式读$about[vel]当然用$rs=mysql_fetch_array($about)来转化成数组也可,对多个字段读取比较方便。 这里仅仅读取一个字段中的一个数据?每次再调用$rs=mysql_fetch_array($about)是否??
$rs = mysql_result($about,0); //可以直接获得一个数据
$about=mysql_query(" select Content from help where ID = '86' "); 应该这样写.
$dbcnx=@mysql_pconnect() ...$about=mysql_query("select Content from help where ID=86",$dbcnx);
$about=mysql_query(" select Content from help where ID = '86' ");$about_row = mysql_fetch_array($about);var_dump($about_row);//或者while($about_row = mysql_fetch_array($about)) { echo $about_row['Content'] }
$about=mysql_query("select Content from help where ID=86");
$about=mysql_query("select Content from help where ID=86");
echo $about; //没内容,也无出错提示
$about=mysql_query("select Content from help where ID=86");
echo $about; //没内容,也无出错提示
--------------------
当然没有内容了,这里的$about是resource类型的,不会显示出来
要用$rs=mysql_fetch_array($about)来转化成数组才能用print_r打印出来。。
echo $about; //显示结果为:Resource id #7
能否有什么简单的方式读$about[vel]当然用$rs=mysql_fetch_array($about)来转化成数组也可,对多个字段读取比较方便。
这里仅仅读取一个字段中的一个数据?每次再调用$rs=mysql_fetch_array($about)是否??
应该这样写.
...$about=mysql_query("select Content from help where ID=86",$dbcnx);
{
echo $about_row['Content']
}
eacho $about[0];