时间:2021-07-01 10:21:17 帮助过:22人阅读
$sql = "select * from fan_keyword where id=(select fval from hao_fan_temp where fkey='keyword_produce_id' limit 1)";$result = mysql_query($sql);$arr = mysql_fetch_assoc($result);if(!empty($arr)){ $keyname = $arr['name']; $idd = intval($arr['id']) + 1;}else{ $sql = "select * from fan_keyword limit 1"; $result = mysql_query($sql); $arr = mysql_fetch_assoc($result); $keyname = $arr['name']; $idd = intval($arr['id']) + 1;} $sql1 = "update hao_fan_temp set fval='$idd' where fkey='keyword_produce_id'"; mysql_query($sql1) or exit('auto_produce: 保存当前抽取的词ID失败');
我想我搞错了,应该是select的时候有读锁,但是不阻塞同一时间其他进程的读操作,所以它读的还是之前的那个数据