Re: Problem with SELECT statement and reference material wanted..
| From: | Eugene Lee | Date: | Thu, 23 Oct 2003 12:16:11 +0000 |
| Subject: | Re: Problem with SELECT statement and reference material wanted.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167257@lists.php.net to get a copy of this message | ||
On Thu, Oct 23, 2003 at 01:57:38PM +0200, P M wrote:
:
: I'm having trouble retrieving a selection of my database contents. The
: problem is when I search for entries that exactly match a search
: criteria, see below:
:
: (database connection established successfully here..)
:
: $result = mysql_query("select * from complete where authorf = '$authorf'");
Try changing this to:
$result = mysql_query("select * from complete where authorf = '"
. mysql_escape_string($authorf) . "'");
: (QUESTION 2)
: Also, another question relevant to PHP/SQL RDBMS's interfacing: Does
: anyoone know where I can find thorough documents on PHP commands for
: this purpose? Some texts which tangents database modelling and
: optimization would be optimal, since I'm interested in those areas
: also!
If you're using MySQL, be sure to be familiar with PHP's MySQL functions.
And the User Contributed Notes is also a valuable source of information.
http://www.php.net/manual/en/ref.mysql.php
As for database optimizations, that more of a MySQL thing. So you should
familiar yourself with MySQL's optimization documentation:
http://www.mysql.com/doc/en/MySQL_Optimisation.html