...

View Full Version : error: mysql_fetch_array(): supplied argument is not a valid MySQL



lli2k5
09-05-2006, 12:21 AM
$result = mysql_query("SELECT FROM at ORDER BY pubdate DESC LIMIT 25");

$AT_array;
$i=0;
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$AT_array[$i]=array($row[0],$row[1],$row[2],$row[3]);
$i++;
}

Why doesn't this work?. I'm tryig to store data from MySQL into an array.

DSB
09-05-2006, 12:53 AM
$arr = array();

$result = mysql_query("SELECT FROM at ORDER BY pubdate DESC LIMIT 25");

while($row = mysql_fetch_array($result){ $arr += $row; }

GJay
09-05-2006, 07:35 AM
The error you're getting means the query is invalid.
You're not actually telling mysql which fields you want to select, you should list them, separated by commas between 'SELECT' and 'FROM'
e.g.
SELECT id, name, birthday FROM at



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum