RE: Re: PHP Search DB Table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
 

 

 		 	   		  

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux