You are viewing our Forum Archives. To view or take place in current topics click here.
Parse error: syntax error, unexpected '['
Posted:

Parse error: syntax error, unexpected '['Posted:

-Abyss-
  • Resident Elite
Status: Offline
Joined: May 18, 201211Year Member
Posts: 230
Reputation Power: 36
Status: Offline
Joined: May 18, 201211Year Member
Posts: 230
Reputation Power: 36
hello guys my php code is messing up can some one help me pls

error code : Parse error: syntax error, unexpected '[' in /home/XXXXX/public_html/inc/classes/resolvers/skype.class.php on line 14

code:


<?php

class SkypeResolver {
function __construct($db) {
$this->db = new DB($db);
}
function get_ip($username) {
$str = $this->skypeurl();
$str .= $username;
$output = file_get_contents($str);
return $output;
}
function skypeurl() {
return $this->db->fetch_array($this->db->query("SELECT * FROM `settings` WHERE `ident`='skype-api-url''val'")
}
}
?>


thank you
#2. Posted:
Hacz
  • V5 Launch
Status: Offline
Joined: Mar 04, 201014Year Member
Posts: 2,891
Reputation Power: 150
Status: Offline
Joined: Mar 04, 201014Year Member
Posts: 2,891
Reputation Power: 150
You forgot to include a terminator after returning the db query.


Last edited by Hacz ; edited 1 time in total
#3. Posted:
-Abyss-
  • Resident Elite
Status: Offline
Joined: May 18, 201211Year Member
Posts: 230
Reputation Power: 36
Status: Offline
Joined: May 18, 201211Year Member
Posts: 230
Reputation Power: 36
Eh? can you add it to the code pls and paste it here
#4. Posted:
VirtualRiot
  • Prospect
Status: Offline
Joined: Oct 23, 201310Year Member
Posts: 637
Reputation Power: 33
Status: Offline
Joined: Oct 23, 201310Year Member
Posts: 637
Reputation Power: 33
I havent a clue on PHP

Sorry
#5. Posted:
iyop45
  • Prospect
Status: Offline
Joined: Apr 15, 201113Year Member
Posts: 614
Reputation Power: 83
Status: Offline
Joined: Apr 15, 201113Year Member
Posts: 614
Reputation Power: 83
Change to this:
return $this->db->fetch_array($this->db->query("SELECT * FROM `settings` WHERE `ident`='skype-api-urlval'"));


Though you really should declare the scope of your functions and the class variables you use, makes for good practice.

* The error you're posting is obviously not right as you have no '[' in your script.


Last edited by iyop45 ; edited 1 time in total
#6. Posted:
Italic
  • Powerhouse
Status: Offline
Joined: Aug 07, 201013Year Member
Posts: 452
Reputation Power: 19
Status: Offline
Joined: Aug 07, 201013Year Member
Posts: 452
Reputation Power: 19
<?php

class SkypeResolver {
function __construct($db) {
$this->db = new DB($db);
}
function get_ip($username) {
$str = $this->skypeurl();
$str .= $username;
$output = file_get_contents($str);
return $output;
}
function skypeurl() {
return $this->db->fetch_array($this->db->query("SELECT * FROM `settings` WHERE `ident`='skype-api-url''val'"));
}
}

?>

Try this
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.