mysqlÊý¾Ý²éѯÎÊÌâ
PHP code:
$query=mysql_query("select * from yonghu_t where yonghu_yhmm=$addusername");
if($query){
echo "<script>";
echo "alert(¡®Óû§ÃûÒѾ´æÔÚ¡¯); window.history.go(-1);";
echo "</script>";
}else{
$sql="insert into yonghu_t (yonghu_yhmc,yonghu_yhmm,yonghu_yhsf,yonghu_lxfs,yonghu_yx,yonghu_jdsj) values('$addusername','$password1','$yhsf','$lxfs','$addemail',$time)";
echo "<br>".$sql;
$return=mysql_query($sql);
}
Òâ˼¾ÍÊÇÏȲéѯ£¬Êý¾ÝÀïÃæÃ»ÓÐÔÙ²åÈ룡¿ÉÊÇÎÒÿ´ÎÖ´ÐС£¶¼²åÈëµ½Êý¾Ý¿âÁË£¬ÕâÊÇÎªÊ²Ã´ÄØ£¿
ÄãµÄÅжÏÓÐÎÊÌâ
if($query)
"select * from yonghu_t where yonghu_yhmm=\"".$addusername."\""
"select * from yonghu_t where yonghu_yhmm=$addusername"====¡·"select * from yonghu_t where yonghu_yhmm='$addusername'"
mysql_query µÄ·µ»ØÖµ false²»ÊDz鲻µ½Êý¾Ý£¬¶øÊÇÄãµÄsqlÓï¾äÓдíÎó¡£
ÅжÏÓÐûÓУ¬Äã¿ÉÒÔд¸ösqlÓï¾ä
$query=mysql_query("select count(*) from yonghu_t where yonghu_yhmm=$addusername");
PHP code:
$sql = "se
Ïà¹ØÎÊ´ð£º
±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......
ÏÖÔÚ×ö¶«Î÷ÒªMySQL£¬Ï£Íû´ó¼Ò½²Ò»ÏÂMySQLÖ§³ÖÄÄЩË÷Òý£¬¶øÇÒʲôʱºò½¨Ê²Ã´Ë÷Òý£¬ÒÔ¼°½¨Á¢ÔÚÄÄЩ×Ö¶ÎÉÏ£¬Ï£Íû¸ßÊÖÀÏÄñ´Í½Ì¡£¡£
×îºÃÊÇ×Ô¼ºÁìÎòµÄµÃ³öµÄ½áÂÛ×îºÃ¡£¡£
Thanks
ºÜ¸´ÔÓµÄÎÊÌ⣬һ°ãÔÚ²éѯ¡¢Á¬½ÓÉ ......
ÐèÇó£º
1 1
2 1
3 2
4 2
5 2
6 3
7 3
8 3
9 3
......