I have a sql query that works when I test directly on the database but fails when placed into my php file. I’m not exactly sure what the issue is, I’m getting a "no data received error’ from chrome. It’s a simple search fileld that is searching through 2 columns in a table.
Here is my php:
[php]if (get_magic_quotes_gpc()) {
$searchterm = stripslashes($searchterm);
}
$searchterm = mysql_real_escape_string($searchterm);
$sql = “SELECT dropbox.id, rma.rma_number, rma.serial_number, status.status_name, ref_categories.category_name, dropbox.mimetype, dropbox.filedata, dropbox.filename, dropbox.date, dropbox.description
FROM dropbox
INNER JOIN rma on rma.id = dropbox.ref_rma_id
INNER JOIN status on status.id = dropbox.ref_status_id
INNER JOIN ref_categories on ref_categories.id = rma.ref_categories_id
WHERE rma.rma_number LIKE ‘%$searchterm%’ OR rma.serial_number LIKE ‘%$searchterm%’ AND rma.ref_categories_id=3
ORDER BY status.id”;
$result = $conn->query($sql) or die(mysqli_error());
[/php]