我想选择拥有石头除以钻石(那些是列)小于 64 的用户,我使用此代码来执行此操作:
$function_Query="SELECT user FROM xraydeath WHERE (stone/diamond) < 64";
$function_Ask = mysql_query($function_Query) or die(mysql_error());
$function_Result = mysql_fetch_row($function_Ask, 0);
echo $function_Result[0];
echo $function_Result[1];
但它输出:
name1
Notice: Undefined offset: 1 in C:\xampp\htdocs\work\test.php on line 19
问题是:如何选择所有用户并从表中回显他们的姓名:
user | diamond | stone
-----+---------+-------
name1| 128 | 145
adam | 12342 | 0
eva | 0 | 123456