PHP MySQL code
I am writing code using PHP and making use of PEAR. When i run my script (i am using scripts from a book) i get the following error:
Quote:
TIA |
Looks like you're calling a function that doesn't exist. Could you post the piece of code around line 233, especially the call to function query()?
|
Ok here is line 233:
Code:
if (DB::isError($rsTmp = $this->_oConn->query($sql))) { |
Quote:
* 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? regards theN |
OK i found the following in common.php in /usr/share/pear/DB
Code:
// }}} 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() What is going on here? |
.
|
Quote:
You could try your luck on the PHP forums at - http://www.phpbuilder.com/, http://www.sitepointforums.com/. Sorry couldn't be of any help. If you do resolve the problem, please post the answers here. regards theN |
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.
|
The sql query, AFAIK is correct as this is code that I got from a book and I have seen a working example at http://wrox.mediatemple.net
|
did you try the sql query in the sql prompt?
|
Running the query, which is
Code:
SELECT news_type_id,news_type FROM holiday_news_types 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. |
Help? Does any1 know anything more?
|
if mysql_query() doesnt work, then maybe php wasnt compiled with mysql.
|
Quote:
|
All times are GMT -5. The time now is 06:08 AM. |