View Single Post
  #14 (permalink)  
Old 17-05-09, 08:49 PM
perplexed's Avatar
perplexed perplexed is offline
Member
 
Join Date: Jan 2009
Posts: 43
Default

Hi black-dog, i was hoping you were still around these forums lol.

First of all i must clarify that 'AND' is included in the query, i had just made a typo when posting it here.

Secondly, wow i like the error_reporting(E_ALL) function, i think i'll be adding that to every single script i ever write.

It threw up the following error,

Fatal error: Function name must be a string in E:\inetpub\vhosts\website.com\subdomains\xxxx\http docs\file.php on line 21

Rather than come running straight back here, i did a little research on Google. Someone with a similar problem was told that

$_POST is an array not a function, access its elements with [] not ()

Now the nearest line to 21 is,

Code:
$sql=stripslashes ("SELECT * FROM database_name WHERE '$a' LIKE '%$b%' ORDER BY '$c'");
I do know that when a line is quoted as a php error it can actually be in the previous line/s. Therefore, i'll mention the segment above which is,

Code:
$a=mysql_real_escape_string($_POST['a']);
$b=mysql_real_escape_string($_POST['b']);
$c=mysql_real_escape_string($_POST['c']);
Would you know if i should replace any of the curved brackets with square ones in any of the above?.

Only in the escape part, there are square brackets, although those are surrounded by circular ones. Alternatively is the fault with the select segment or the inclusion of stripslashes (which had to used on lycos).
Reply With Quote