Jump to content

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?

Link to comment
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.
Link to comment
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.
Link to comment
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
Link to comment
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
Link to comment
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
Link to comment
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.
Link to comment
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)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.