View Single Post
  #3 (permalink)  
Old 03-03-09, 02:31 PM
perplexed's Avatar
perplexed perplexed is offline
Member
 
Join Date: Jan 2009
Posts: 43
Default

Quote:
Originally Posted by jon123 View Post
I don't see anything wrong with your query.
I can only assume that your problem is with $b.
If $b is empty then it would explain why it prints all the records as the % relates to anything.

Can you give an example of what $b is? and were register_globals on or off with your previous host, and this one.
Been a long time since had to compile php and MySql scripts for a specific purpose (as ony needed to do it the initial time and leave them running for years).....but....mention of register_globals will be well worth my checking out. Lycos has closed down and wiped it's servers clean, however, i'm sure i printed out the variables and settings for their MySql.

$a, $b and $c are web page form fields. It would read, as an example, select 'songs' from 'database' where 'title' like '%love%' order by 'artist'.

The inclusion of the wildcards '%' mean that it would select all coulumns in a record row containing song titles such as 'I Love You' 'Do You Love Me' etc.

The actual web page contains various types of queries using varying number of fields as one wishes or needs and with or without the wildcard option.

Last edited by perplexed; 03-03-09 at 02:33 PM.
Reply With Quote