Jump to content

Not THAT urgent, offer your free help at any time you wish


sabo86

Recommended Posts

You're breaking out of the query incorrectly.

 

$query = "select * from items where Category = '.$_POST['searchtype'].'";

 

See how you open the string with " but then when you get the the = you break out using '.

 

Try this:

 

$query = "select * from items where Category = ".$_POST['searchtype']."";

Thanks for that..

I am trying to re structure my code because i am not getting results..

what's the problem in this code:

 

if($_POST['searchtype']="Accessories")

  {$field="Accessories";}

  else if ($_POST['searchtype']="Seatings")

  {$field="Seatings";}

  else if ($_POST['searchtype']="Local Office Furniture")

  {$field="Local Office Furniture";}

    else if ($_POST['searchtype']="European Office Furniture")

  {$field="European Office Furniture";}

 

$query = "select * from items where Category = $field;

 

The error i am getting is :

Parse error: parse error, unexpected '>' in C:\Program Files\EasyPHP 2.0b1\www\test fleifel\results.php on line 55

 

and line 55 is : echo "<p>Number of records found: ".$num_results."</p>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.