Drezard Posted January 23, 2008 Share Posted January 23, 2008 Im getting an error I have no clue what it means: Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in C:\xampp\htdocs\rgk\extensions\generator.php on line 20 So heres my code: generator.php <?php include('extensions/includes/connection.inc.php'); $database = new connection; class generator { public $username; public $query; public $phrase_id; public $phrase; function generate () { $this->username = 'tom'; $this->query = "SELECT phrase_id FROM user_ids WHERE username='$username'"; $this->phrase_id = $database::fetch_one($this->query); $this->query = "SELECT phrase FROM admin_paraphrases WHERE phrase_id='$phrase_id'"; $this->phrase = $database::fetch_one($this->query); echo $this->phrase; } } and just incase you need the fetch_one function from database.inc.php: function fetch_one($query) { $this->result = mysql_query($query); $this->output = mysql_fetch_array($this->result); $this->variable = $this->output[0]; return $this->variable; } What have I done wrong? Daniel Quote Link to comment https://forums.phpfreaks.com/topic/87459-unknown-error/ Share on other sites More sharing options...
teng84 Posted January 23, 2008 Share Posted January 23, 2008 include('extensions/includes/connection.inc.php'); class generator { $database = new connection; public $username; public $query; public $phrase_id; public $phrase; function generate () { $this->username = 'tom'; $this->query = "SELECT phrase_id FROM user_ids WHERE username='$username'"; $this->phrase_id = $database->fetch_one($this->query); $this->query = "SELECT phrase FROM admin_paraphrases WHERE phrase_id='$phrase_id'"; $this->phrase = $database->fetch_one($this->query); echo $this->phrase; } } try to do something like that.. the error says you used :: that is incorrect Quote Link to comment https://forums.phpfreaks.com/topic/87459-unknown-error/#findComment-447311 Share on other sites More sharing options...
Drezard Posted January 23, 2008 Author Share Posted January 23, 2008 Yea, tried that on before: Fatal error: Call to a member function fetch_one() on a non-object in C:\xampp\htdocs\rgk\extensions\generator.php on line 24 Any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/87459-unknown-error/#findComment-447318 Share on other sites More sharing options...
teng84 Posted January 23, 2008 Share Posted January 23, 2008 include('extensions/includes/connection.inc.php'); class generator extends connection{ public $username; public $query; public $phrase_id; public $phrase; function generate () { $this->username = 'tom'; $this->query = "SELECT phrase_id FROM user_ids WHERE username='$username'"; $this->phrase_id = parent::fetch_one($this->query); $this->query = "SELECT phrase FROM admin_paraphrases WHERE phrase_id='$phrase_id'"; $this->phrase = parent::fetch_one($this->query); echo $this->phrase; } } try Quote Link to comment https://forums.phpfreaks.com/topic/87459-unknown-error/#findComment-447327 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.