set_time_limit(0);
define ( 'BUILD_ID', 1039 );
-define ( 'FRIENDIKA_VERSION', '2.10.0908' );
+define ( 'FRIENDIKA_VERSION', '2.10.0909' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
define ( 'EOL', "<br />\r\n" );
function __construct($server,$user,$pass,$db,$install = false) {
$this->db = @new mysqli($server,$user,$pass,$db);
- if((mysqli_connect_errno()) && (! $install)) {
+ if(! mysql_connect_errno()) {
+ $this->connected = true;
+ }
+ else {
$this->db = null;
- system_unavailable();
+ if(! $install)
+ system_unavailable();
}
- else
- $this->connected = true;
}
public function getdb() {
public function q($sql) {
- if(! $this->db )
+ if((! $this->db) || (! $this->connected))
return false;
$result = @$this->db->query($sql);
}
public function escape($str) {
- return @$this->db->real_escape_string($str);
+ if($this->db && $this->connected)
+ return @$this->db->real_escape_string($str);
}
function __destruct() {