Stearmandriver Posted May 17, 2008 Share Posted May 17, 2008 Hi all, nice forum! I've been messing around with creating a pretty basic PHP/MySQL web app in Dreamweaver CS3. I've got it mostly built and working well on my local machine now. The thing is, EVERYTHING is local right now - all the site files, and the MySQL database. I'm using IIS as a testing server. So, question is: what happens when I publish this? From what I understand, different web hosts have different locations for MySQL databases. Ok, when I pick a host and set up an account, I'll export my local database to wherever my web host wants it on their server. But... what does this do to the database connection in my website, as defined by Dreamweaver? It's something like "localhost" right now, as the database is living in the default MySQL folder on my local computer. When I publish the site, it'll need to connect to the database on the web host's server, so it seems like I'll need to change this connection? And if I do, is it just the connection info that needs to be edited, or does this screw up every recordset I've created? Dumb questions, I know. Sorry I have to do it the newb way with DW. I'm good with HTML and CSS, but a long ways away from handcoding in PHP. Thanks much... Link to comment https://forums.phpfreaks.com/topic/106030-dumb-question-php-mysql-database-connection-and-site-publishing/ Share on other sites More sharing options...
awpti Posted May 17, 2008 Share Posted May 17, 2008 If the DB is local to the server, then 'localhost' as the hostname will work. Most hosts will tell you what to change the hostname too, so just look for that information. You'll just need to import your DB content. As an aside, make sure you do NOT use DW code as examples for your own PHP Learning. It's the worst of the worst as practices and garbage code goes. Link to comment https://forums.phpfreaks.com/topic/106030-dumb-question-php-mysql-database-connection-and-site-publishing/#findComment-543399 Share on other sites More sharing options...
Stearmandriver Posted May 17, 2008 Author Share Posted May 17, 2008 Hey, thanks for the quick reply. I figured I'd need to search the host's documents for that... didn't occur to me that "localhost" might actually work. Makes some sense though, and it'd be a happy accident. If I do need to change the hostname, I just do that in the connection info, and I don't have to screw with the recordsets, right? As an aside, make sure you do NOT use DW code as examples for your own PHP Learning. It's the worst of the worst as practices and garbage code goes. Yeah, I've heard that. I'm not a programmer though, and for now, DW accomplishes what I'm needing to do. I imagine one day that won't be the case. That's the day I'll convince myself I actually have time to learn this stuff in earnest. Thanks very much for the info... Link to comment https://forums.phpfreaks.com/topic/106030-dumb-question-php-mysql-database-connection-and-site-publishing/#findComment-543403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.