【发布时间】:2011-05-07 16:36:35
【问题描述】:
$sql_2 = 'SELECT id, firstname, lastname, birthday, location, occupation, telephone, email, picture FROM pinkmoon_pending ORDER BY `id` DESC LIMIT 1';
$result_2 = mysql_query($sql_2);
while ($row = mysql_fetch_row($result_2)
{
$firstname = row['firstname'];
$lastname = row['lastname'];
$birthday = row['birthday'];
$location = row['location'];
$occupation= row['occupation'];
$telephone = row['telephone'];
$email = row['email'];
$picture = row['picture'];
}
mysql_free_result($result_2);
这是我在使用 PHP 选择行后尝试向我显示的行。
这似乎不起作用 - 任何人都可以帮助我吗? :)
【问题讨论】:
-
当您将结果限制为最大值时,您不需要执行循环。 1 行,
if就足够了。并在使用关联数组时使用mysql_fetch_assoc。