CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 PHP newbie question

Print topic Send  topic

Author Message
nmjudy
Posted: 06/15/2003, 2:27 PM

I'm trying to install "Classifeds" onto my server. The database has been created - with ALL user privileges for myself (this is done by my hosting service). The MySQL interface says that the tables have also been created. I can browse the tables and everything appears to be there.
According to the readme-php.txt documentation, I changed the common.php file to contain my MySQL information for DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, and DATABASE_HOST. When I try to load the Default.php page, I get an error saying -
Fatal error: Call to undefined function: odbc_pconnect() in /home/nmjudy2/albuquerque-new-mexico-www/classified/db_odbc.inc on line 35

I think my problem is with the db_odbc.inc file. I've tried entering information into the following for $Host, $Database, $User, and $Password:
class DB_Sql {
var $Host = "localhost";
var $Database = "my_database_name";
var $User = "my_user_name";
var $Password = "my_password";
var $UseODBCCursor = 0;

I'm not sure if I need to do anything to line 35 of the code:

$this->Link_ID=odbc_pconnect($this->Database, $this->User, $this->Password, $this->UseODBCCursor);

I still get the following error:

Fatal error: Call to undefined function: odbc_pconnect() in /home/nmjudy/albuquerque-new-mexico-www/classified/db_odbc.inc on line 35

Am I staring right at the problem? Any suggestions would be appreciated.

RonB
Posted: 06/15/2003, 3:40 PM

I take it from your info you do not have CC or CCS?
The problem is in the connectionstring, you are trying to use an odbc connection to MySQL. It is likely though that your ISP does not support this. Most ISP's that offer php and mysql do not support an odbc connection to the database. Why would they when php has mysql support build in as a standard feature wisch also happens to be a lot faster then any odbc connection.
The error states as much, odbc_pconnect() is undefined. Ofcourse it is because when using mysql and php the line should read something like mysql_pconnect()
I've read the common.php that comes with the classifieds project and it is only for odbc. What you could do is download the trial version of CC and load the project files set the database to mysql the language to php and enter the details for your connection. Then regenerate the entire project and install it on the server.

Ron
nmjudy
Posted: 06/15/2003, 4:09 PM

Thanks Ron! I was actually trying to figure out where the MySQL_connection statement should go.

I don't have CC or CCS. I'm game to try your suggestion. Where can I find the trial version of CC to download? I'd love to ask what CC or CCS is - but I'd settle for a link and try to figure it out.
nmjudy
Posted: 06/15/2003, 5:44 PM

Okay...now I feel stupid. I figured out what CC and CCS is and am currently downloading the trial as suggested. I really didn't see the whole picture before. I look forward to playing around with CodeCharge to see it's capabilities.
nmjudy
Posted: 06/15/2003, 6:57 PM

I've downloaded CodeCharge, the tutorial and CodeCharge manual. I've read the tutorial and skimmed the manual for CodeCharge, looking for how I create a mysql_pconnect string. I wish there was an example. I am running on an Apache Server using MySQL and PHP4. When I run Code Charge, I get as far as the DataBase tab. I select "CUSTOM" and click on the disk icon to build a connection string. It forces me to select an OLE DB Provider - which I understand I shouldn't need. When I test the connection, I get an error saying:

Test connection failed because of an error in intializing provider.....invalid connection string attribute. Does anyone know how I would override this?
nmjudy
Posted: 06/16/2003, 4:42 AM

I found this tutorial by searching for "mysql":
http://support.codecharge.com/kb_article.asp?s_keyword=...=&article_id=50

Does this apply to my problem? I'm not sure if this is just a windows solution. All the documentation seems to favor the windows platform. Do I have to do everything in the tutorial just to get a connection string something similar to:

$dblink = mysql_pconnect("$dbhost","$dbuser","$dbpasswd");

????????????????

I currently have running an Apache server on my local machine with PHP 4.1.1 and MySQL 3.23.03-nt installed and fully operational. I've created simple PHP applications by using Dreamweaver MX with some extra PHP extensions. The server, MySQL and PHP all work fine. If I could get past this connection problem - I think I could do something creative with the code.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.