ÇóÖú!!mysqlÊý¾Ý¿â²éѯÎÊÌâ - PHP / »ù´¡±à³Ì
ÕâÊÇÎÒµÄÒ»¶Î´úÂë:
<?php
$store_poster=$_POST['poster'];
$store_title=$_POST['title'];
$store_message=$_POST['message'];
$store_parent=$_POST['parent'];£¨parent ÊǸöÊý×Ö£¬ÆäËüµÄ¶¼ÊÇ×Ö·û´®£©
//check not a duplicate
$conn=mysql_connect('localhost','root','lvliangwei');
mysql_select_db('lvyou', $conn) or die ('Can\'t use lvyou : ' . mysql_error());
$query="select header.postid from header ,body where
header.postid=body.postid and
header.parent=".$store_parent." and
header.poster='".$store_poster."' and
header.title='".$store_title."' and
body.message='".$store_message."'";
$result=mysql_query($query)or die("invalid query: " . mysql_error());
if(!$result){return false;}
$num_rows=mysql_num_rows($result);
ÔÚä¯ÀÀÆ÷ÖÐÔËÐÐʱ³öÏÖÈëÏÂÌáʾ£º
invalid query: 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 'and header.poster= and header.title= and body.message='
ÕâÊÇÔõô»ØÊ ÎÒµÄ$queryÓï¾ä¸³ÖµÓдíô£¿
$store_poster $store_title $store_message ¶¼ÊÇ¿Õ
Äã°ÑÄÇЩֵ給ÉÏ
addslashes
Óï¾äÊÇûÓÐÎÊÌ⣬Ӧ¸ÃÊÇÄã²åÈëµÄÖµµÄÎÊÌâ¡£¿ÉÄÜÊÇûÓн«
Ïà¹ØÎÊ´ð£º
Ôڲɼ¯Ò»¸öÒ³ÃæµÄʱºòͨ³£¶¼ÊÇʹÓÃfile_get_contents($url)
²»¹ý·µ»ØµÄ½á¹ûÓÐʱºò»á²»È«
Èç¹ûÔÚhtmlÖÐʹÓà document.ready,ÔÚÒ³Ãæ×¼±¸ºÃºó£¬Ê¹ÓÃajax¶ÁÈ¡±ðÒ»²¿·ÖµÄÊý¾Ý
ÔÙͨ¹ýÐÞ¸Ähtml±êÇ©µÄÄÚÈÝ£¬¾Í²¿·ÖµÄÊý¾Ý¾ ......
ĿǰÔÚÎ人ÕÒ¹¤×÷
·¢Ïִ󲿷ֹ«Ë¾ÎÞÍâºõÁ½ÖÖ
Ò»ÖÖÊǸãÍâ°üµÄ ÒªÓÃzend,cakephpµÈÍâ¹ú¿ò¼Ü
»¹ÒªÊìϤÍâ¹ú¿ªÔ´ÏµÍ³
Ò»ÖÖ¹úÄÚµÄ ÎÞÍâºõ dedecms ecshop shopexÕ⼸ÖÖ¸ÄÕ¾µã ÓеĹ«Ë¾ÉõÖÁÄÃһЩ¸üСµÄϵͳ¸ ......
String sqlCount="select count(*) from usertable where username='"+
userName+"'";Õâ¾ä»° ʲôÒâ˼°¡£¡
Õâ¾ä»°Êä³ö³öÀ´¾ÍÊÇ
select count(*) from usertable where username='ÄãµÄ±äÁ¿ ......
1¡¢ÊDz»ÊÇPHPÖÐÖ»ÄÜʹÓÃmysql_query("update user_aa set money=money2-".$bpanmm." where uid=".$userppp);¸üÐÂÊý¾Ý£¿£¿£¿
2¡¢PHP¸üÐÂmysql_fetch_row($res)Óëmysql_fetch_array($res)ÖеÄÊý¾ ......
ÔÚÏÂһѧϰPHP¿ìÒª°ëÄêÁË£¬µ«ÊÇPHP»¹ÊDz»ÖªµÀÔõôÑù°ÑPHPÔËÓõ½ÏÖʵÖУ¬Ï£ÍûÓиßÊÖÓÃPHP×öºÃÁ˵Ķ«Î÷£¬¹©Ð¡µÜѧϰ²Î¿¼Ò»Ï£¬ÒÔ±ãÌá¸ß×Ô¼ºµÄˮƽ¡£
QQ£º766139989
ÏëÒª×öºÃµÄ¶«Î÷£¬ Ϊʲô²»È¥Ï¸ö¿ªÔ´µÄ³ÌÐòÀ´¿´ ......