dbuuch
Posts: 3
|
| Posted: 02/20/2008, 6:34 PM |
|
Hi,
I downloaded the standard PHP "classified" application source code and I'm trying to get it to work. I followed the instructions and provided all the required variables as given to me by my Internet Hosting company. However, I am still getting the following on line 30 in the db_odbc.inc file"
"Fatal error: Call to undefined function: odbc_pconnect() . . ."
The following is the relevant section of the code
class DB_Sql {
var $Host = "yyyyyyyyy";
var $Database = "yyyyyyyyyy";
var $User = "yyyyyyyyy";
var $Password = "yyyyyyyy";
var $UseODBCCursor = 0;
var $Link_ID = 0;
var $Query_ID = 0;
var $Record = array();
var $Row = 0;
var $Errno = 0;
var $Error = "";
var $Auto_Free = 0; ## set this to 1 to automatically free results
function connect() {
if ( 0 == $this->Link_ID ) {
$this->Link_ID=odbc_pconnect($this->Database, $this->User, $this->Password, $this->UseODBCCursor);
if (!$this->Link_ID) {
$this->halt("Link-ID == false, odbc_pconnect failed");
}
}
}
Can anyone help me figure out what i'm doing wrong or what i need to tweak further?
|
 |
 |
mrachow
Posts: 509
|
| Posted: 02/20/2008, 11:58 PM |
|
Usually the error message Quote :undefined for all kinds of ..._connect or ..._pconnect (for persistent connection) is a hint that the corresponding data access modul is not included in the php engine or is not activated.
But usually on a Windows hosts ODBC should be included in every PHP installation.
Does your provider surely offer ODBC connection?
_________________
Best regards,
Michael |
 |
 |
dbuuch
Posts: 3
|
| Posted: 02/21/2008, 11:20 PM |
|
Thanks Mike,
I just spoke with my webhosting company and here's what they said. They said the data access module comes with php 5 and so in order to have that i'd need to convert from php4 to php5. They upgraded my php package to php 5 and asked me to convert my scripts to php5. to do this they asked me to create a .htaccess file with this text in it - AddHandler x-httpd-php5 .php.
After doing the above, the old fatal error has now disappeared but instead i now have all my sql statements displaying in the browser. Please see http://ucanmap.com/classified/default.php for what i'm talking about. Would I now need to do something to the code itself (convert to php5) to fix this?
Thanks in advance for your help.
Regards,
Dbuuch
|
 |
 |
datadoit
|
| Posted: 02/22/2008, 5:20 AM |
|
Create a phpinfo.php page with:
<?php
phpinfo();
?>
and let's see what you have going on.
|
|
|
 |
wkempees
|
| Posted: 02/22/2008, 6:25 AM |
|
and check your sources for $DB<Connection>->Debug = True
"datadoit" <datadoit@forum.codecharge> schreef in bericht
news:fpmi6t$fiu$1@news.codecharge.com...
> Create a phpinfo.php page with:
>
> <?php
>
> phpinfo();
>
> ?>
>
> and let's see what you have going on.
|
|
|
 |
dbuuch
Posts: 3
|
| Posted: 02/22/2008, 7:36 AM |
|
Done! I have created the phpInfo.php
Please see the report at http://ucanmap.com/classified/phpinfo.php
Also, I have had to delete the .htaccess file because it was causing my pages NOT to load. When its there and I try to open ucanmap.com/classified/default.php, for example, i get this strange thing whereby the page tries to open up in photoparade and I get the error: "Photoparade player cannot open this file".
Please help me understand what's going on in this report.
Thanks,
Dbuuch
|
 |
 |
DonB
|
| Posted: 02/22/2008, 8:23 AM |
|
My guess is you are trying to pconnect to an Access database, since I assume
you took the example as-is and published it to a non-windows server. Or did
you set up a MySQL database? If MySQL, then it should have said
mysql_pcnnect().
I don't know about using the Access database on a non-Windows host. Maybe
it's do-able, but I think it's fewer headaches to build a MySQL database
instead. You can still reference the Access example database as the local
database while developing.
--
DonB
"dbuuch" <dbuuch@forum.codecharge> wrote in message
news:547bce33b2f5c8@news.codecharge.com...
> Hi,
>
> I downloaded the standard PHP "classified" application source code and I'm
> trying to get it to work. I followed the instructions and provided all the
> required variables as given to me by my Internet Hosting company. However,
> I am
> still getting the following on line 30 in the db_odbc.inc file"
>
> "Fatal error: Call to undefined function: odbc_pconnect() . . ."
>
> The following is the relevant section of the code
>
>
> class DB_Sql {
> var $Host = "yyyyyyyyy";
> var $Database = "yyyyyyyyyy";
> var $User = "yyyyyyyyy";
> var $Password = "yyyyyyyy";
> var $UseODBCCursor = 0;
>
> var $Link_ID = 0;
> var $Query_ID = 0;
> var $Record = array();
> var $Row = 0;
>
> var $Errno = 0;
> var $Error = "";
>
> var $Auto_Free = 0; ## set this to 1 to automatically free results
>
> function connect() {
> if ( 0 == $this->Link_ID ) {
> $this->Link_ID=odbc_pconnect($this->Database, $this->User,
> $this->Password, $this->UseODBCCursor);
> if (!$this->Link_ID) {
> $this->halt("Link-ID == false, odbc_pconnect failed");
> }
> }
> }
>
>
> Can anyone help me figure out what i'm doing wrong or what i need to tweak
> further?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|