I don't know if its possible.
I released a script version 1.0 and now I am about to release 1.2 version and i made some upgrade in database tables like change name field size or default value also added few new columns and table then export full db to .sql file(new db).
Is it possible from php to import new .sql file and add new tables and also change columns structure without deleting any data from table and add new columns in existing tables ?
I tried to import it but it shows this error :
'ALTER TABLE table1
ADD PRIMARY KEY (id
); ': Multiple primary key defined
Example :
Old Database v1.0
Table 1
ID (primary key , AI)
First Name(size-50 ,default - none)
Last Name(size-50 ,default - none)
Email(size-50 ,default - none)
Password(size-50 ,default - none)
New Database v1.2
Table 1
ID (primary key , AI)
First Name(size-100 ,default - none)
Last Name(size-100 ,default - none)
Email(size-255 ,default - none)
Password(size-50 ,default - none)
Gender (size 10 , default - none)
Added Table 2
ID (primary key , AI)
coloum1 (size-100 ,default - none)
coloum2 (size-255 ,default - none)
Is it Possible to import new .sql over old database without loosing any data from php and also add data from new database?
I done my best to explain hope you understand.
EDIT : I use this code to import new .sql file and its not working: how to import .sql file in mysql database using php