Jump to content

HELP on query please


kanala

Recommended Posts

Something's gone wrong after the "LIKE" please correct what symbols are required.Thanks

$result2 = mysql_query("SELECT * FROM Products WHERE Similar LIKE \"%$row%['Similar']\" LIMIT 8");while($row2 = mysql_fetch_array($result2))

Link to comment
Share on other sites

$result2 = mysql_query("SELECT * FROM Products WHERE Similar LIKE \"%$row[Similar]%\" LIMIT 8");

You were trying to reference the array value incorrectly.I'm wrong again! :) ah well I learn something everyday too :)

Link to comment
Share on other sites

That should still have quotes in it. It is not correct to reference an associative array in a string without quotes, you are causing an extra constant lookup every time you do. Enable all error messages to see the notice for that one.$result2 = mysql_query("SELECT * FROM Products WHERE Similar LIKE \"%{$row['Similar']}%\" LIMIT 8");

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...