Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty and Pear::DB question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
lean4huskytop
Smarty Regular


Joined: 19 Aug 2003
Posts: 41

PostPosted: Wed Jan 07, 2004 6:53 am    Post subject: Smarty and Pear::DB question Reply with quote

i was able to install SMARTY and PEAR :: DB package and Mail Package on my local home computer with Apache thorugh Foxserve.

When I upload stuff to the "real" server" it gives this error:

Fatal error: Call to undefined function: query() in /home/advenure/public_html/index.php on line 10

You can see it at www.TrainerDirectory.net

I installed the PEAR packeges properly, since on other pages, the Mail package works fine.

The problem is with the query() function thats in the common.php under DB folder....and the db.php is being included as opposed to the common.db. Has anyone had a problem with the Pear:db installation?

Am I missing something in the include_path? I can connect to the DB.php, but not the common.php in the pear/db/ folder.

very strange...please help

Paul
Back to top
View user's profile Send private message
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Wed Jan 07, 2004 8:39 pm    Post subject: Reply with quote

Actually I had similar problems when an invalid SQL statement was used.
Make sure to add error reporting to your SQL connections,queries, ... or comment the query line to see if it really is the query itself causing the problem.
Back to top
View user's profile Send private message
lean4huskytop
Smarty Regular


Joined: 19 Aug 2003
Posts: 41

PostPosted: Wed Jan 07, 2004 8:46 pm    Post subject: Pear DB with PHP and SMARTY Reply with quote

You are the babe...I will take a look at that now...who knows - maybe you are right..

I will let you know
Paul
Back to top
View user's profile Send private message
lean4huskytop
Smarty Regular


Joined: 19 Aug 2003
Posts: 41

PostPosted: Wed Jan 07, 2004 8:52 pm    Post subject: Reply with quote

I just tried, and it didnt help..I will turn on SQL errors so that I can see in detail how to do that

I will have to dig for tjh einfo....do you know off hand how to turn on the sql error reporting?

Paul
Back to top
View user's profile Send private message
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Wed Jan 07, 2004 8:58 pm    Post subject: Reply with quote

Ok,
there are error reporting examples on the connect and query pear db documentation pages:
http://pear.php.net/manual/en/package.database.db.intro-connect.php
http://pear.php.net/manual/en/package.database.db.intro-query.php

Also,
can you post that line 10 from your /home/advenure/public_html/index.php file in here? Maybe you used the pear db wrong.
Back to top
View user's profile Send private message
lean4huskytop
Smarty Regular


Joined: 19 Aug 2003
Posts: 41

PostPosted: Wed Jan 07, 2004 9:26 pm    Post subject: Pear DB with PHP and SMARTY Reply with quote

here is line 10:

Code:

$mainQueryResult = $db->query($sql);


the code is fine, because it works on my local machine.

For some reason the pear/db/common.php is not being recognized in the path.

Paul
Back to top
View user's profile Send private message
lean4huskytop
Smarty Regular


Joined: 19 Aug 2003
Posts: 41

PostPosted: Wed Jan 07, 2004 9:32 pm    Post subject: Pear DB with PHP and SMARTY Reply with quote

hey

well I got something here: it turns out that for some reason I cant connect to the databse:

now here is what I am getting:

DB Error: connect failed

I am going to see why I cant connect to the database.

Thanks for the links...I didnt do "error checking" for database connectivity, and since it worked on my local machine I assumed [ BAD BAD BAD ] that it would work on the life server.

Thanks ...will keep you posted...
Back to top
View user's profile Send private message
lean4huskytop
Smarty Regular


Joined: 19 Aug 2003
Posts: 41

PostPosted: Wed Jan 07, 2004 9:34 pm    Post subject: YOU did it Reply with quote

HOLY SHI* HOLY SHI*

DUDE

you just helped me solve a 2 day dillema

JEZUZ CHRIST>>>

check out www.TrainerDirectory.net

its working....now I have to upload the rest of the code

WHAT A DRAMAA
Back to top
View user's profile Send private message
Duncan
Smarty Pro


Joined: 16 Dec 2003
Posts: 166

PostPosted: Wed Jan 07, 2004 9:43 pm    Post subject: Reply with quote

You are welcome Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP