Jump to content

Archived

This topic is now archived and is closed to further replies.

ns1025

HELP! I NEED TO CONNECT TO MY DATABASE

Recommended Posts

I have a few questions for you experienced people out there:

I have my php files in the Apache2.2/Homeblog/htdocs folder. When I access my index.php file on my Browser under http://localhost/HomeBlog/index.php I get this error message:


Fatal error: Call to undefined function mysql_pconnect() in C:\Web\Apache2\htdocs\HomeBlog\Connections\connBlog.php on line 9

In my connBlog.php I have the following definitions.

$hostname_connBlog = "mysql";
$database_connBlog = "blg_blog";

I am not sure, but I think that is what I need to set the values to. I think geocities database hostnames are always mysql. Also, do I pick the database name that I defined in phpMyAdmin for the database_connBlog?

So why is it that I still can't connect to my database?

Share this post


Link to post
Share on other sites
The problem is you havnt enabled the mysql extension for PHP5. Have a read of [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]this thread[/url] to enable the mysql extension for PHP5.

Share this post


Link to post
Share on other sites
Thats not it. I already enabled the mysql extensions and I also defind the path to my folders.

I followed the instructions in Step-by-Step Help from NicholasSolutions very closly.

Thank you very much, any help is greatly appreaciated.

Share this post


Link to post
Share on other sites
Well if you have enabled it then you should be able to use the ysql functions. You may have uncommented the extension within the php.ini, but is PHP using the correct php.ini file, have you moved a file called libmysql.dll to C:\WINDOWS?

Also when you move or change any settings with php/apache make sure you restart Apache.

Also could provide details of you PHP setup so I can try an recreate your problem on my local dev server.

Share this post


Link to post
Share on other sites
I am so stuck  :-[

I guess PHP is using the right php.ini file. Where or in which file would I have to change or check the file name?

However, I think my PHP setup is ok, because I tested it by going to http://localhost/Homeblog/phpinfo.php

My PHP files including php.ini are saved in C:\Web\PHP and my apache files are saved in C:\Web\Apache2.
All my php including index.php are saved in the C:\Web\Apache2\htdocs\Homeblog file.

It would be great if you would tell me what information you need in order to understand my setup because I have no clue as of where to start explaining.

Could you also maybe give me an example of how you connect to your database, host name and database name?

Thanks,
Nathalie

Share this post


Link to post
Share on other sites
I should also tell you that...
My web host is Geocities or yahoo and I want to connect to my online database blg_blog.

Share this post


Link to post
Share on other sites
Hey wildteen,

I got the installation part all figured out with the help of
http://www.puremango.co.uk/cm_wamp_97.php
I did not know that there was a php.ini in C:\Windows. I had to uncomment the extension in that file.
And I had to copy C:\PHP\ext\php_mysql.dll to C:\Windows.

I still haven't figured out how to connect to my database on geocities.
Thanks for all your help,

Nathalie

Share this post


Link to post
Share on other sites
So you are running on localhost trying to connect to your db at geocities? If so, alot of hosting companies will not allow remote connections to their db severs except thru their own hosting servers. Just one thought.

Share this post


Link to post
Share on other sites
I would run my blog remote if I would know how?
What do I type into the URL window.
When I try to see my php pages online I get a blank page
like the one at
http://www.nathaliesteinfeld.com/Blog/blg/index.php
(/Blog/blg/ is where I store my php files on my online webserver)

I would hate all my work to go to waste just because of an technical small problem

I found a page at geocities.com that explains how to define host and database
http://help.yahoo.com/us/geo/mysql/mysql-06.html
This site talks about localhost too. But I can't make it work.

Hope that makes it clearer

Share this post


Link to post
Share on other sites
Thanks so much. I attached the folder.
You can tell me anytime if you need more info.

[attachment deleted by admin]

Share this post


Link to post
Share on other sites
Just small suggestion, I hope you don't need to do any coding changes
for this. Just need to have the permissions for your IP at Geocities.
To know this just open the cpanel of geocities in the main page click
the mysql databse and in that page you will find the list of IPs
which are having permissions to access that database.Just you need
to put one entry of  your IP there. I am sure this will solve your problem.

Share this post


Link to post
Share on other sites
;D
Cool! You are the man!
I didn't know about this feature.

But I am still not clear about the details.
When adding an A Record in my ADVANCED DNS Settings what do I put in the SOURCE FIELD and do I enter my IP address in the destination field? Not thinking anything (duh), I added the following A Record to my settings.

Source:www.nathaliesteinfeld.com
Destination: MY_IP

And of course every time I tried to access my website it was forwarded to my computer administrator login.

If I set my advanced settings up the right way, what am I calling up as my URL to view my Blog?
Would it be something like the following??
http://localhost:8080/Homeblog/index.php
(the folder Homeblog is a subfolder in my Apache htdocs)

Share this post


Link to post
Share on other sites
It won't workout for local machines.
If we want to connect to a remote database
you must need to access that database from a
static IP. That is your public IP. You just need
to give your IP address at the remote db access
panel.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.