My Search isn't Working!

Hi all, I’m guessing I’ve missed something minor out but I my search doesn’t appear to want to work. The results are in the database as when I search in PHPMyAdmin the results display. My connection is also working.

<?php
require('includes/connection.php');
$search = "SELECT * FROM 'customers' WHERE 'c_firstname' LIKE '%coxdabd%'";
				while ($searchnow = mysql_fetch_array($search)){
					echo '<div class="searchRes">Hello</div>';
				}
echo "Hello World";
?>

Increase error reporting and the error will show itself, its quite a simple one to resolve too. :wink:


error_reporting(-1);
ini_set('display_errors', true);

Hi Anthony, thanks as always, will save that small peice of code for future reference. All working beautifully now. Cheers dude :smiley:

No problem. :slight_smile:

then you must’ve tested a different query than the one you posted here, which cannot possibly work, as you are trying to retrieve data from a string –

FROM 'customers' 

instead of from a table –

FROM `customers` 

or –

FROM customers 

see the difference?

:slight_smile: