emvy03 Posted June 7, 2011 Share Posted June 7, 2011 Alright Lads. I've had a go at building a CMS using an apache server, but this is all local to my PC and I was wondering how to go about uploading it to the internet. The problem I think I am having is that I am using phpmyadmin locally, however when I upload the cms to the internet it tells me that it failed to connect to the database. I assume this is due to the fact the CMS is online, while the database is still saved locally. Apologies for asking such a daft question but I am really quite new to php scripting and web design. Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/238678-content-management-system/ Share on other sites More sharing options...
gristoi Posted June 7, 2011 Share Posted June 7, 2011 Ok, where are you 'uploading' your cms to? and does your web hosting have mysql support / databases . If so then you need to: 1. export your local database into an sql file. 2. change your connection details in your php connection script to match youronline databases mysql users details 3. import your sql file into the online database Quote Link to comment https://forums.phpfreaks.com/topic/238678-content-management-system/#findComment-1226513 Share on other sites More sharing options...
Maq Posted June 7, 2011 Share Posted June 7, 2011 Pretty much what gristoi said, you should use mysql dump (http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html) to create the sql file. You can probably use the PHPMyAdmin GUI as well if that's easier. After you dump your database live your hosting panel should allow you to create MySQL users, from there you just have to change your configuration script with the new credentials. Quote Link to comment https://forums.phpfreaks.com/topic/238678-content-management-system/#findComment-1226523 Share on other sites More sharing options...
emvy03 Posted June 8, 2011 Author Share Posted June 8, 2011 Hi, Thanks for that guys. Also, I was wondering if there is a way to assign an id to a post when adding it to the database. The reason I ask is the current 'add-content' script doesn't assign an id to the posts and therefore the database won't accept the new post because the 'id' column can't be null. Hope I've explained it at least a little. Cheers guys. Quote Link to comment https://forums.phpfreaks.com/topic/238678-content-management-system/#findComment-1226960 Share on other sites More sharing options...
Maq Posted June 8, 2011 Share Posted June 8, 2011 You should have an auto-incrementing column that will automatically assign a unique value to each entry. Quote Link to comment https://forums.phpfreaks.com/topic/238678-content-management-system/#findComment-1226969 Share on other sites More sharing options...
emvy03 Posted June 8, 2011 Author Share Posted June 8, 2011 Legend. Cheers for that mate. Quote Link to comment https://forums.phpfreaks.com/topic/238678-content-management-system/#findComment-1227053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.