Jump to content

Query Issue


redgunner

Recommended Posts

if(!$seldb) {
// Show error if we cannot connect.
echo 'ERROR: Could not connect to the database.';
} else {
// Is there a posted query string?
if(isset($_POST['queryString'])) {

$queryString = mysql_real_escape_string($_POST['queryString']); //this’s the old code ($db->real_escape_string($_POST['queryString'])
if(strlen($queryString) >0) {
$query = mysql_query('SELECT value FROM countries WHERE value LIKE ‘$queryString%’ LIMIT 10');
if($query) {
while ($row = mysql_fetch_assoc($query)){//$query ->fetch_object()) {
foreach( $row as $v )
{
echo ”.$v.”;
}
}
} else {
echo 'ERROR: There was a problem with the query.';
}
} else {
// Dont do anything.
} // There is a queryString.
} else {
echo 'There should be no direct access to this script!';
}
}

 

I keep getting There was a problem with the query on PHP4...

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/213444-query-issue/
Share on other sites

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.