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 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); } 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.. 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
Archived
This topic is now archived and is closed to further replies.