好的,下面是我的代码,我尝试使用 var_dumps 对其进行调试 .. var_dump($insertion) 返回通过,这意味着查询插入到数据库中,但由于某种原因,当我想查看时,我会收到警告消息如果 mysql_num_rows 正在完成它的工作并且它返回 FALSE 并带有标题的警告消息.. 下面是我简短的直接代码
<?php
require'sensdb.php';
if (sensdb_connect()) {
$select = "SELECT SubGroupID from STx WHERE GroupID = '39'AND Status ='Provisioned'";
$result = mysql_query($select);
$result_count = mysql_num_rows($result);
if($result_count > 0)
{
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if($row['SubGroupID'] != 123) {
$insert = "INSERT INTO Routes (SubGroupID,GroupID,URL) VALUES (".$row['SubGroupID'].",39,'mailto://e2pressure@gmail.com')";
$insertion = mysql_query($insert);
$insertion_count = mysql_num_rows($insertion); var_dump($insertion_count);
$select_route_id = "SELECT RouteID FROM Routes WHERE SubGroupID =".$row['SubGroupID']." AND GroupID = 39";
$result_route_id = mysql_query($select_route_id);
$result_route_count = mysql_num_rows($result_route_id);
if($insertion_count > 0 ) {
if($result_route_count > 0) {
$row_route = mysql_fetch_array($result_route_id,MYSQL_ASSOC);
$update = "UPDATE STx SET RouteID =".$row_route['RouteID']." WHERE SubGroupID =".$row['SubGroupID']."";
var_dump($update);
}
}
}
}
}
}