//查找表B中body是否含有"php"这个词:
$sql = "select from B where body like '%php%'";
$result = mysql_query($sql,$conn);
$num = mysql_num_rows($result,$conn);
if($num!=0)
{
//符合条件时更新表A的key值为php
$sqlupdate = "update A,B set key = 'php' where Aid=Baid";
if(mysql_query($sqlupdate,$conn))
{
echo "update A‘key success~!";
}
else
{
echo "update A'key failure~~~";
}
}
欢迎分享,转载请注明来源:品搜搜测评网