SQL查询没有错误消息

EDIT: Found the error. The sting replace statement was adding an extra space. Fixed now, thanks.

I've been looking at this too long, I can't find the error.

Here's what I've got:

echo $client_name." - ".$location;  
$query = mysql_query("SELECT * FROM spc_clients WHERE (client_name='".$client_name."' AND location='".$location."')") or die(mysql_error());  
while ($results = mysql_fetch_array($query)) {  
    // Other code...
}

When I echo, I get 'Client1' and 'Location1". When I put the SQL query into PHPMyAdmin, and replace those values, the query runs fine and brings up results. On the page it's on, I get nothing.

I have no syntax errors, and the mysql_error isn't coming back with anything either.

What am I missing?

try this

$query = mysql_query("SELECT * FROM spc_clients WHERE client_name="'.$client_name.'" AND location="'.$location.'" ") 

Try this:

$query = sprintf("SELECT * FROM spc_clients WHERE client_name='%s' AND location='%s'",trim($client_name),trim($location));
$query = mysql_query($query);