我想计算我的用户数,然后发送命令来更新不同的表,以更改他们在个人资料上显示的“级别”。这就是我得到的......
<?php
$query = mysql_query("SELECT COUNT(*) FROM 'ow_base_user'.'id' WHERE 'id'") or die (mysql_error());
$row = mysql_fetch_row($query);
$count = $row[0];
$username = [userid];
$count = "";
$lvl = UPDATE `founda_Inspire`.`ow_base_authorization_role` SET `name` = 'empower' WHERE `ow_base_authorization_role`.`id` =13; }
if ($count >= 2720) { $lvl = UPDATE `founda_Inspire`.`ow_base_authorization_role` SET `name` = 'integrity' WHERE `ow_base_authorization_role`.`id` =18; }
else if ($count >= 625) { $lvl = UPDATE `founda_Inspire`.`ow_base_authorization_role` SET `name` = 'honor' WHERE `ow_base_authorization_role`.`id` =17; }
else if ($count >= 125) { $lvl = UPDATE `founda_Inspire`.`ow_base_authorization_role` SET `name` = 'passion' WHERE `ow_base_authorization_role`.`id` =16; }
else if ($count >= 25) { $lvl = UPDATE `founda_Inspire`.`ow_base_authorization_role` SET `name` = 'creative' WHERE `ow_base_authorization_role`.`id` =15; }
else if ($count >= 5) { $lvl = UPDATE `founda_Inspire`.`ow_base_authorization_role` SET `name` = 'inspire' WHERE `ow_base_authorization_role`.`id` =14; }
?>