Home  >  Article  >  Backend Development  >  MYSQL查询解决方法

MYSQL查询解决方法

WBOY
WBOYOriginal
2016-06-13 13:52:29948browse

MYSQL查询
if   (substr($remessage,0,2)== 'TP '){
$PSN=str_replace( 'TP ', ' ',$remessage);
echo   $PSN;
exit;
sql= "select   id   from   tempnum   where   id= ' ".intval($PSN). " ' ";
$rs=$conn-> execute($sql);
if   ($rs-> EOF)
{
SMSSendReturnStr($config[ 'sp '],$rs-> fields[ "MobileNum "], '对不起,请没有找到您要投票的人,请核对。谢谢您的参与 ');
}
else{
$conn-> execute( "update   tempnum   set   PS=PS+1   where   id= ' ".$PSN. " ' ")
}
break;
exit;

}

--------------------------------------
$remessage是用户通过手机发来的短信       ,格式为TP000001       TP后面是数字对应的ID,但是不知道为什么总是查询那出错,先短信格式正确


Parse   error:   syntax   error,   unexpected   '= '   in   D:\web\XXX\XXX.php   on   line   90


XIEXIE

------解决方案--------------------
sql= "select id from tempnum where id= ' ".intval($PSN). " ' ";
===================
$sql = ".... ";

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn