23-03-1394، 03:32 ب.ظ
دوستان این کلاس چه ایرادی داره کلا کوئری اجرا نمی کنه
class Dal { private static $con; public function __construct() {} public static function Connect(){ $config = loader::load('Configs'); if(self::$con == null || gettype(self::$con) != 'resource' ){ self::$con = mysql_connect($config->dbHost,$config->dbUser,$config->dbPass)or die('can not connect to mysql'); mysql_select_db($config->dbName); mysql_query('SET NAMES 'utf8''); mysql_set_charset('utf8'); } } public static function Query($query){ if(!self::$con){ self::Connect(); } echo $query; return mysql_query($query); } public static function ArrayQuery($query){ $resault = array(); $values = self::Query($query); if($values && mysql_num_rows($values) > 0){ while($value = mysql_fetch_assoc($values)){ $resault[] = $value; } } return $resault; } }