js 通过 ajax 连接mysql 菜鸟求个例子 使用了 zf框架 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 js、ajax是不能连接mysql数据库的,应该是js通过PHP返回结果 为啥有得人士说 是通过ajax返回的呢? http://www.w3school.com.cn/php/php_ajax_database.asp PHP代码:$link = mysql_connect('localhost','root','123456');mysql_select_db('test',$link);mysql_query('set names utf8',$link);$result = mysql_query('select row from test limit 1',$link);if(($row=mysql_fetch_array($result))!==false){ echo $row;}else{ echo "no data";}JQuery代码$.ajax({ url: 'test.php', cache: false, type: 'GET', success: function(html){ alert(html) }});Mootools代码new Request({ url: 'test.php', method: 'GET', success: function(html){ alert(html) }}); mvc架构适合用在商城系统吗? 怪异的PHP上传问题 请教一个简单的正则问题 多个行的文本框post,怎么识别呢。 php从帖子表读出数据进行排序问题 下面有两段代码为什么执行结果不一样,帮解释,谢谢 一个关于 .gif 文件显示的问题。 请教 用PHP运行Windows的命令。 javascript 数组问题 smarty3.0出现错误提示function call 'clear_all_cache' is unknown or deprecated. addslashes()
mysql_select_db('test',$link);
mysql_query('set names utf8',$link);
$result = mysql_query('select row from test limit 1',$link);
if(($row=mysql_fetch_array($result))!==false){
echo $row;
}else{
echo "no data";
}JQuery代码$.ajax({
url: 'test.php',
cache: false,
type: 'GET',
success: function(html){
alert(html)
}
});Mootools代码new Request({
url: 'test.php',
method: 'GET',
success: function(html){
alert(html)
}
});