PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Oct 17, 2019 6:35 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Aug 12, 2007 8:06 pm 
Offline
Forum Contributor

Joined: Sun May 20, 2007 9:26 am
Posts: 364
Hi
I get this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in g:\programs new\easyphp\www\adcenter\bid.php on line 86
code is:
Syntax: [ Download ] [ Hide ]
<?php

  foreach ($lines as $nrow => $keyword){

$getbid="SELECT id FROM listing WHERE keyword LIKE %$keyword% ORDER BY maxb DESC LIMIT 5";

$fivebids=mysql_query($getbid);



//table data inputs goes here



 

 

     ?>

    <tr>

 

            <td> <?php  $keyword ?> </td>

            <td> <?php getcost($keyword, $id)  ?> </td>

            <td> <?php getrank ($keyword, $id)  ?> </td>

            <td> Auto Bid</td>

            <td> <?php echo $maxb;  ?> </td>

     <?php       while($frow=mysql_fetch_array($fivebids)){ ?>

         

            <td> <?php echo getcost($keyword, $frow['id']) ;  ?> </td>

     

            <?php

             }

                       

            ?>



  </tr>

  <?php

       }

?>

what's wrong? :?
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 8:18 pm 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger
Syntax: [ Download ] [ Hide ]
$fivebids=mysql_query($getbid) or die(mysql_error().': '.$getbid);


see also: http://dev.mysql.com/doc/refman/5.1/en/ ... rator_like


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 8:22 pm 
Offline
Forum Contributor

Joined: Sun May 20, 2007 9:26 am
Posts: 364
thanks
I replaced that line and it says:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%% ORDER BY maxb DESC LIMIT 5' at line 1: SELECT id FROM listing WHERE keyword LIKE %% ORDER BY maxb DESC LIMIT 5


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 8:25 pm 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group