version 0.1
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
//test if not directly called
|
||||
if ( !isset($site) )
|
||||
{
|
||||
require_once( "config.inc.php" );
|
||||
@ -10,7 +11,7 @@ require_once "log.php";
|
||||
|
||||
class dbDolibarr extends dbcore
|
||||
{
|
||||
protected $server = "192.168.1.251";
|
||||
protected $server = "192.168.1.250";
|
||||
protected $port = 3306;
|
||||
protected $user = "dolibarr";
|
||||
protected $passwd = "mysql_dolibarr";
|
||||
@ -31,6 +32,7 @@ class dbcore
|
||||
public $connect;
|
||||
public $result;
|
||||
public $id;
|
||||
public $error;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
@ -65,14 +67,12 @@ class dbcore
|
||||
|
||||
function query( $string )
|
||||
{
|
||||
|
||||
//log_write( $string );
|
||||
$this->error = 0;
|
||||
if ( empty( $this->connect ) ) $this->open();
|
||||
|
||||
$this->result = $this->connect->query( $string ) ;
|
||||
$error = $this->connect->error;
|
||||
if ( $this->connect->errno > 0 ) log_error( "Échec de la commande query => " . $error . "<br />" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, false);
|
||||
return $error;
|
||||
$this->error = $this->connect->error;
|
||||
if ( $this->connect->errno > 0 ) log_error( "Échec de la commande query => " . $this->error . "<br />" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, false);
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,6 @@ class dbcore
|
||||
{
|
||||
$flag = 0;
|
||||
$query='SELECT IF(identifiant="' . $idVotant . '" AND idVotation="' . $idVotation .'" AND INSTR(idVote, "' . $idVote .'"),TRUE,FALSE) as r FROM liste_votants';
|
||||
//$query='SELECT EXISTS (SELECT * FROM liste_votants WHERE (SELECT INSTR(idVote, "' . $idVote .'"))';
|
||||
$this->query($query);
|
||||
if ( ($r = $this->result->fetch_array(MYSQLI_ASSOC)))
|
||||
{
|
||||
@ -103,7 +102,7 @@ class dbcore
|
||||
}
|
||||
}
|
||||
}
|
||||
return 255;
|
||||
return 'Error ';
|
||||
}
|
||||
|
||||
function resultat()
|
||||
|
Reference in New Issue
Block a user