Re: [SPAM] Re: [PHP] Attempting to search a MySQL database from PHP not working
| From: | Jason Pruim | Date: | Fri, 01 Jun 2007 12:27:35 +0000 |
| Subject: | Re: [SPAM] Re: [PHP] Attempting to search a MySQL database from PHP not working | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255964@lists.php.net to get a copy of this message | ||
On May 31, 2007, at 5:43 PM, Richard Lynch wrote:
On Thu, May 31, 2007 2:25 pm, Jason Pruim wrote:To use the newbie scape goat, I don't know how else to do it, and it seems to work :) What would you recommend? I am always open to find ways to make my code better/faster/more secure.Hi Everyone, I am attempting to setup a search field on a database application I'm dinking around with and running into problems that I'm hoping someone might be able to shed some light on. Here is the code I am using to display the results of the search: echo ('<table border="1">'); echo "<tr><th>First Name</th><th>Author</th><th>Pages</th></tr>"; $result_row[] = mysql_query($query) or die(mysql_error());I also have to wonder why you are building an array of query result resources... You probably could do this with just one SQL query and some order by clauses to get what you want, without hitting the DB so much.