Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2006, 12:21 AM   PM User | #1
lli2k5
New Coder

 
Join Date: Aug 2006
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
lli2k5 has a little shameless behaviour in the past
error: mysql_fetch_array(): supplied argument is not a valid MySQL

$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.
lli2k5 is offline   Reply With Quote
Old 09-05-2006, 12:53 AM   PM User | #2
DSB
New Coder

 
Join Date: Mar 2006
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
DSB is an unknown quantity at this point
Macintosh

PHP Code:
$arr = array();

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

while(
$row mysql_fetch_array($result){ $arr += $row; } 
__________________
www.b-a-k-e-r.com

Last edited by DSB; 09-05-2006 at 01:08 AM..
DSB is offline   Reply With Quote
Old 09-05-2006, 07:35 AM   PM User | #3
GJay
Senior Coder

 
Join Date: Sep 2005
Posts: 1,791
Thanks: 5
Thanked 36 Times in 35 Posts
GJay is on a distinguished road
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
GJay is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:52 PM.


Advertisement
Log in to turn off these ads.