corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » mysql function help :D


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author mysql function help :D
waynep
Member

Registered: 20th Apr 02
Location: london
User status: Offline
   20th Jul 03 at 20:07   View User's Profile U2U Member Reply With Quote

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
20th Jul 03 at 20:50   View User's Profile U2U Member Reply With Quote

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
20th Jul 03 at 20:59   View User's Profile U2U Member Reply With Quote

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' ) . '";' );
}

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
forum hacking - SQL's Drew Geek Day 15 1520
9th Sep 04 at 23:50
by Ian
 
Server Help Jodi_the_g Geek Day 7 1369
19th Jan 06 at 15:18
by Jodi_the_g
 
My SQL-Nearly there! Tom J Geek Day 31 2899
25th Dec 06 at 23:32
by Ian
 
Fuzzy search text added to Location Services Ian General Chat 10 900
4th Feb 07 at 00:02
by mav
 

Corsa Sport » Message Board » Off Day » Geek Day » mysql function help :D 28 database queries in 0.0089810 seconds