我已经成功地插入数据从短信和我的短信content$text_utf8插入两个columns$p_n和$msg。现在我的问题是
当客户发送带有code$p_n的短消息时,短信脚本从数据库中查找code$p_n是否与客户短信引脚$text_utf8、$p_n完全匹配,然后更新$msg和$phone等列。
$phone = $_GET["phone"];
$ix=strpos($text_utf8,' ');
if($ix!==false) {
$p_n=trim(substr($text_utf8, 0, $ix));
$msg=trim(substr($text_utf8, $ix+1));
if(strlen($p_n)!=0 && strlen($msg)!=0) {
$wrong_format=FALSE;
$p_n = mysqli_real_escape_string($con, $p_n);
$msg = mysqli_real_escape_string($con, $msg);
// creating an sql statement to insert the message into the pin_man table
$sql="UPDATE smss SET msg='$msg' AND phone='$phone' WHERE p_n='$p_n'";
// executing the sql statement
mysqli_query($con,$sql);
}
}发布于 2016-05-06 04:09:47
查询应类似于以下用途:
$sql="UPDATE smss SET msg='$msg', phone='$phone' WHERE p_n='$p_n'";https://stackoverflow.com/questions/37063926
复制相似问题