homepage Welcome to WebmasterWorld Guest from 54.161.192.130
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Noob questions about PHP and MySQL
PHP MySQL
Protospleen

5+ Year Member



 
Msg#: 3901560 posted 3:03 pm on Apr 27, 2009 (gmt 0)

Hi All,

I've only just started with PHP and MySQL, and I have set up a localhost apache server.

I have a few questions about how best to go about bulding and testing a website that will interface with a database.

At present, I am using PHP scripting, to get(and put) data to a database that I have defined on localhost using phpmyadmin. What happens when I want to "upload" my website?

Do I need to change all the php code to now reference the host's server location?

How do I upload my table? (or must I dynamically create the table on the first load of the site?)

What is the 'best practise' method for building and testing php/mysql websites?

Thanks. :)

 

d40sithui

5+ Year Member



 
Msg#: 3901560 posted 3:42 pm on Apr 27, 2009 (gmt 0)

You should have 2 instances of your website. One being the development(the testing server) and one the production (the one the world sees). Typically, these are hosted on two servers with identical LAMP/WAMP configurations. You may want to set your "hosts.allow" setting to only let in certain people and block everyone else from your development server. I'm sure other people will have more information, but this will give you something to think about.

Protospleen

5+ Year Member



 
Msg#: 3901560 posted 9:07 am on Apr 28, 2009 (gmt 0)

Thanks d40sithui, this whole project(learning php/mysql/html) has given me plenty to think about!

It's a uniquely rewarding experience when things work, and an unmatched frustration when they don't! :)

I'm glad to have this forum to help me! :)

d40sithui

5+ Year Member



 
Msg#: 3901560 posted 2:28 pm on Apr 28, 2009 (gmt 0)

yeah i know what you mean. i've only been on this for around 2 years and i've learned alot and keep learning more everyday! in regards to your question about moving tables, i think the best way is to do a mysqldump and copy your entire table schema into your target database. phpadmin should have something like this - although i haven't used it (i just ssh into the database via telnet client). good luck and have fun

HelenDev

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3901560 posted 2:42 pm on Apr 28, 2009 (gmt 0)

Do I need to change all the php code to now reference the host's server location?

It's definitely worth considering splitting your code down into include files if you haven't already. That way when you have to make a change to something you only have to do it once rather than multiple times. The connection to your database would normally be in an include file for example.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved