The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Need to upload site containing a database

I have created a website with 5 pages, one of which is a
gallery page. I have had the site running for a year now.
My gallery page was a plain html one. Now I have created
a gallery page containing photos from a database. I have
links in my gallery page to the various categories of
photos and also next previous links in the respective
category pages. I also have an admin page where I can
add, delete and edit categories and photos. I have tested
my site on my local machine and it is working fine.

Now I am in the process of uploading this gallery page to
my host's server. I have a few doubts.

1. Do I need to create a database by going to the
phpadmin on the cpanel of my host? Can I just go to the
phpadmin on my local server and then export the database?
If I do that, will my database, the tables, their
respective fields and the photos that are contained in the
database get exported?

2. Or do I create the database and the respective tables
and their fields in the phpadmin section of the cpanel of
my host and then do the exporting of the data from the
local server? I tried doing this on the server's phpadmin
but found that the name of the database got changed e.g
the name of my database was photogallery. When I went to my server's phpadmin on the cpanel, I had to give a user
name and the name of the database that got created is now jppp_photogallery (I had given my user name as jppp). So, now I will have to change the name of the database on my config.php file.

3. When creating a database and the tables and their
fields, what is the advantage of writing mysql statements?
Can one just go to the phpadmin section of the local
server and enter the respective text fields that are
readily available?

What is the best way to have the database working on my
host's server?

I hope I am posting in the right forum. If I am not, I would request any moderator to move it to the right forum.

There are some good free tutorial videos on youtube that show you how to use phpmyadmin for mysql database (and tutorial videos for every other kind of database you can think of). Just go to youtube and seach for "How to use mysql" "How to use phpmyadmin" and phrases like that.

Thanks to all of you. I had some personal issues and could not pursue this topic for quite some time and I am coming back to this thread after more than a month. For the past 2 weeks or so, I have been googling a lot and trying to see what I could do.

I made some sample databases and tried to export them from the local host to my webhost’s server. But I have failed miserably and am finally coming to the forum again for help.

Cassidy, how does one go to the config file? I spent a lot of time googling this but failed to see the config file showing what you have shown in your thread. Can you guide me on this? I have not succeeded in understanding sql dump either.

After checking out some tutorials, I tried importing a database that I had created as a sample. I had created a database which had a table with a few fields and I had inserted some data into the tables (All this was done on my local machine). I then went to phpmyadmin and then exported the database as per the instructions of a tutorial. Then I went to the phpadmin of my webhost’s cpanel. I am using the services of hostgator. I tried importing the files. I followed all the instructions given in the tutorial, but get the message, error 1044: Access denied for jppp@localhost to database 'gallery'. Now jppp is my user name and the name of the sample database that I created is gallery. I tried going to the privileges section and tried to make necessary changes but have not succeeded. Can any of you help me please?