php链接mysql ajax

时间:2015.04.05 发布人:

php链接mysql ajax

已解决问题

谷歌用户在2015.04.05提交了关于“乐驰php链接mysql ajax”的提问,欢迎大家涌跃发表自己的观点。目前共有3个回答,最后更新于2024-09-02T21:01:07。

<metacharset="utf-8"/>

<?php

$con=mysql_connect('localhost','root','root');

mysql_query('useshop',$con);

mysql_query('setnamesutf8',$con);

$res=mysql_query('selectcount(id)fromgoods');

$m=Math.floor(Math.random()*($res)+1;

echo$m;

?>

错误为:Parseerror:syntaxerror,unexpected';'inD:\phpStudy\WWW\work\chu_li.phponline9

怎么解决?


我想链接**库随机取出每一行内容再把每一个字段分开要怎么弄啊?我在另一个页面用ajax获取这些**

希望大家能够帮助她。

详细问题描述及疑问:

<metacharset="utf-8"/>

<?php

$con=mysql_connect('localhost','root','root');

mysql_query('useshop',$con);

mysql_query('setnamesutf8',$con);

$res=mysql_query('selectcount(id)fromgoods');

$m=Math.floor(Math.random()*($res)+1;

echo$m;

?>

错误为:Parseerror:syntaxerror,unexpected';'inD:\phpStudy\WWW\work\chu_li.phponline9

怎么解决?


我想链接**库随机取出每一行内容再把每一个字段分开要怎么弄啊?我在另一个页面用ajax获取这些**

期待您的答案,谢谢你帮我,祝你快乐,愿你事事如意 !
希望以下的回答,能够帮助你。

第1个回答

用户名:承接网站开发  

whil联仅发短长e($arr=mysql_fetch_aray($res)){

car_**mp($arr);

}

你执行完这段以后赵进界四你就知道怎么弄了

第2个回答

用户名:麦瑞菠萝  

承接网站开发采纳率:28%14级2015.04.05

while($arr=mysql_fetch_aray($res)){car_京系侵样什掌限更**mp($arr);}


$sql="select*fromtablewhere1=1orderbyrand()LIMIT1";//orderbyra坏nd();//随意


第3个回答

用户名:特洛宜  

$sql="select*气院蚤将打界跟均fromtablewhere1=1orderbyrand()LIMIT1";//orderbyrand();//随意