how do update a database without wiping out the entire DB

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

how do update a database without wiping out the entire DB

Post by gautamz07 »

I currently update my database my exporting it in PHP admin from my local setup and then importing my database on my server online , This wipes out all the entries on my online database.

ususally since i am still working on my blog , i just need to update a columb etc , so how do update a database without wiping out the entire databsse online ?

Thank you.
Gautam.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how do update a database without wiping out the entire D

Post by requinix »

Use statements like ALTER TABLE to change columns.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: how do update a database without wiping out the entire D

Post by Celauran »

You might want to consider using migrations. Laravel has them built in, or you can use something like Phinx.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: how do update a database without wiping out the entire D

Post by gautamz07 »

@requinix Thanks , though i am not directly writeing the sql to my production database.

@celauran ! thats totally skipped me , thanks , will try and use migrartions , chekced out phinx , its nice TY :)
Post Reply