class database{
function config($part){
$sql = mysql_query("SELECT ".$part." FROM configuration");
if($sql){
echo 'ok';
}
else{
echo 'no sql';
}
}
}
This doens't work for some reason...
As soon as I remove the command mysql_query(); it says that $sql exists...
Does anyone has a solution for this problem?
We'll need confirmation on the run from the op, add an or die(mysql_error()); to end the mysql query call.
Interestingly enough, the actual resource is global.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php