bogdaniel Posted March 22, 2009 Share Posted March 22, 2009 hello i'm having a problem with a wrapper for mysql_query please cand someone help me ? var $is_connected; // the var for mysql_connect public static function query($sql) { line 33: $this->query = mysql_query($sql, $this->is_connected); if (!$this->query) { echo "error"; } return $this->query($sql); } And the error i'm having Fatal error: Using $this when not in object context in classes\mysql.class.php on line 33 i can't figure it out how should i do Quote Link to comment https://forums.phpfreaks.com/topic/150576-solved-php-wrapper-for-mysql/ Share on other sites More sharing options...
FaT3oYCG Posted March 22, 2009 Share Posted March 22, 2009 $this->link = mysql_connect($host, $user, $pass); mysql_select_db($db); function Query($query) { $this->theQuery = $query; return mysql_query($query, $this->link); } Quote Link to comment https://forums.phpfreaks.com/topic/150576-solved-php-wrapper-for-mysql/#findComment-790940 Share on other sites More sharing options...
bogdaniel Posted March 22, 2009 Author Share Posted March 22, 2009 $this->link = mysql_connect($host, $user, $pass); mysql_select_db($db); function Query($query) { $this->theQuery = $query; return mysql_query($query, $this->link); } thank you very much for your help. i solved the problem it was from the variables.. Quote Link to comment https://forums.phpfreaks.com/topic/150576-solved-php-wrapper-for-mysql/#findComment-791233 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.