mysql_query returning boolean instead of mysql ressource
Posted on
16th Feb 2014 07:03 pm by
admin
Hi,
I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the query in a string format (SQL is working properly) and a database ressource which is also good. The problem is that even with good parameters, the mysql_query returns me bogus data
exact code that cause problem
Code: public function execute($query){
$result = mysql_query($query, $this -> ressource);
return $result;
} // execute
the full database object code
Code: class DBconnexion{
private $host; // database url/host
private $user; // database login name
private $pass; // database login password
private $db; // database name
private $ressource; // mysql ressource for database
public function DBconnexion($db_host, $db_user, $db_pass, $db_name){
$this -> host = $db_host;
$this -> user = $db_user;
$this -> pass = $db_pass;
$this -> db = $db_name;
// connect to database
$cnDB = mysql_connect($this -> host, $this -> user, $this -> pass);
mysql_select_db($this -> db, $cnDB);
// store database ressource in database object
$this -> ressource = $cnDB;
} // DBconnexion (constructor)
// getter for database ressource
public function get(){
return $this -> ressource;
} // get_connexion
public function execute($query){
$result = mysql_query($query, $this -> ressource);
return $result;
} // execute
public function number($sqlRessource){
$result = mysql_num_rows($sqlRessource);
return $result;
} // number
public function row($sqlRessource){
$result = mysql_fetch_row($sqlRessource);
return $result;
} // row
} // DBconnexion
No comments posted yet
Your Answer:
Login to answer
311
37
Other forums
Hashing?
Hi, I was hoping to take a string value then convert it - consistently - across each of our pages in
Having Problem with Date
l have a submit buttom where user have the possibility to add a date to specify when his message s
How to separate records and ORDER BY
Let say i have 100 records and displayed in one page, then i want to get the records from 50-100 and
Sending a hyperlink through mail
HI all,
I am sending a mail to outlook mailbox of a user using FM SO_NEW_DOCUMENT_ATT_S
Error when call dll from oracle
Hi all, please help me!
I have dll write C language, I want call it from oracle procedur
Significance of BPM
Hi Experts,
I am a novice in BPM , I just want to know how BPM as permenant department is
Multi Level Array Problem
hi all,
For example I have array like below:
$temp = array(array('north america', 'us'
Email to a friend script problems
I have this send-to-a-friend script with 2 issues:
1) When you open the form popup on a p
How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons
Simple program to copy files between two computers over the web
I use logmein free and often need to move files between my two computers. Generally, I move the file