Re: Search Engine Problem

From: Date: Thu, 25 Oct 2001 22:40:47 +0000
Subject: Re: Search Engine Problem
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-10039@lists.php.net to get a copy of this message
what does the code that displays the results look like? jim ----- Original Message ----- From: "DL Neil" <PHPml@DandE.HomeChoice.co.uk> To: "Mark Sweeney" <mark@nintendoodle.com>; <php-windows@lists.php.net> Sent: Thursday, October 25, 2001 3:20 PM Subject: Re: [PHP-WIN] Search Engine Problem > I am using this piece of code to display news articles based on the variables inputted by a user. However, it will only > display one article, never more, even if more are within the terms of the "WHERE" clause. What am I doing wrong? > > $search = mysql_query("SELECT news.ID, newstitle, newsdescription, newsdate, author, email FROM news, authors WHERE > $name LIKE '%$value%' AND authors.ID=AID ORDER BY news.ID DESC"); > if (!search) { > echo("<p>Sorry, there are no matches for what you are looking for. Please try again</p>"); > exit(); > } > > > > Mark, > This piece of code interrogates MySQL and responds with a "result identifier resource" or ResourceSet or ResultSet or > RecordSet, depending upon your terminology. How do you thereafter 'unpack' the rows from the resource set - using for eg > mysql_fetch_assoc()? (else see manual) > Have you tried copying that SELECT statement (substituting values appropriately) and running it under native SQL or in a > 'management tool', to be sure it actually works (regardless of PHP)? > Regards, > =dn > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.windows (#10039) next »