waynep
Member
Registered: 20th Apr 02
Location: london
User status: Offline
|
im running a query and i hav an error on this line
while($newObject= mysql_fetch_array($newestsql)) {
this is the error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
|
Joff
Member
Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
|
Have you printed out the contents of $newestsql?
See what you're trying to pass to mysql_fetch_array.
|
waynep
Member
Registered: 20th Apr 02
Location: london
User status: Offline
|
yup
i hav now changed part of the query to
while($newObject=$DB_site->fetch_array($newestsql)) {
so the FULL query is now
$newestsql=$DB_site->query("SELECT * FROM gal_Object where Freigabe='y' order by newat desc limit 1");
while($newObject=$DB_site->fetch_array($newestsql)) {
$getnewthumb=$DB_site->query_first("SELECT * FROM gal_Pictures where Object='$newObject[ID]' ORDER BY rand() DESC LIMIT 1");
// get a random pic of the car
$tmpnew=explode(".",$getnewthumb[filename]);
$newthumbfilename="gt_".$tmpnew[0].".jpg";
eval( '$newestsql = "' . gettemplate( 'home_newest' ) . '";' );
}
|