2017-05-30 40 views
-2

下面是我的代码看起来像如何使用php存储变量中影响的行数?

$update = mysql_query("update profile set status=1 where id='$id_ex'")or die("error from $update".mysql_error()); 

printf("Affected record is : %d\n", mysql_affected_rows()); 

感谢

+0

'$变量= mysql_affected_rows()函数; ' – Mike

回答

0

在varaiable

$update = mysql_query("update profile set status=1 where id='$id_ex'")or die("error from $update".mysql_error()); 
$affected_rows = mysql_affected_rows(); 
printf("Affected record is $affected_rows"); 
下面

直接存储是php文件建立 mysql_affected_rows()