RE: [PHP-WIN] Re: PHP Search DB Table
| From: | Oliver Kennedy | Date: | Tue, 14 Dec 2010 12:55:31 +0000 |
| Subject: | RE: [PHP-WIN] Re: PHP Search DB Table | ||
| References: | 1 2 3 4 | Groups: | php.db php.windows |
| Request: | Send a blank email to php-db+get-47530@lists.php.net to get a copy of this message | ||
David, Sascha thank you both for your help. Using the query
$query = "SELECT * FROM clients WHERE clientid = '$term'";
echo $query . '<br />';
$result = mysql_query($query);
as suggested printed out the below
SELECT * FROM clients WHERE clientid = ''
This seems to indicate that it is not seeing the value within the single quotes. However a slight
caveats to that
If I change what is contained within the quotes to a specific number then it does read it, for
example
SELECT * FROM clients WHERE clientid = '123456';
So it is only when I enclose a value that it doesn't compute, I tried putting the $term within
%% like so
$query = "SELECT * FROM clients WHERE clientid = '%".$term"%'";
however this just returns we page not found, possibly because I need to use the LIKE parameter in
there somewhere?
Many thanks for all your help on this
Kind Regards
Oliver