ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
if (DB::isError($rsTmp = $this->_oConn->query($sql))) {
catchExc($rsTmp->getMessage());
return false;
}
Please help us help you.
* check if there is a function called query() in the file or in include files, if any.
* post the content of the query function.
* has PEAR been setup as per instruction i.e. is it in a place where PHP can find it?
OK i found the following in common.php in /usr/share/pear/DB
Code:
// }}}
// {{{ query()
/**
* Send a query to the database and return any results with a
* DB_result object.
*
* @access public
*
* @param string $query the SQL query or the statement to prepare
* @param string $params the data to be added to the query
* @return mixed a DB_result object or DB_OK on success, a DB
* error on failure
*
* @see DB::isError
* @see DB_common::prepare
* @see DB_common::execute
*/
function &query($query, $params = array()) {
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
return $sth;
}
$ret = $this->execute($sth, $params);
$this->freePrepared($sth);
return $ret;
} else {
$result = $this->simpleQuery($query);
if (DB::isError($result) || $result === DB_OK) {
return $result;
} else {
return new DB_result($this, $result);
}
}
}
strangely DB.php (which is the include for the class.news.php file) does not contain an include for common.php
PEAR has been setup with the installatino script provided and has also had the includes for it included in the .htaccess and is a default include shown in phpinfo()
hi, i don't know PEAR but i know in php/mysql if your sql command has the wrong syntax it gives you an error "mysql_query() not a function" or something almost exactly like your error. doulbe check tom ake sure the $sql command you are using is actually correct.
SELECT news_type_id,news_type FROM holiday_news_types
works fine.
Going to inspect logs etc. see if i can find anthing there. I have seen hints that it may be DSN difinition is incorrect, but i have checked and it seems to be fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.