this query is not working , is it right?

$sql="alter table `$tname` change `$old_field_name` `$field_name1` , `$old_field_type` `$dropdown` ";
designersxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pratima PharandeCommented:
which database you are using

if it is sql then syntax must be

$sql="alter table `$tname` set `$old_field_name`= `$field_name1` , `$old_field_type`= `$dropdown` ";
0
Pratima PharandeCommented:
sorry for last post...........
check this syatax

alter table [table name] change [old column name] [new column name] varchar (50);

I think you need to give the datatype also
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
designersxAuthor Commented:
i am using mysql database and php.

i want to write the query for 2 fields.
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

designersxAuthor Commented:
i wrote this query in mysql database to check if it runs but it does not runs.
0
designersxAuthor Commented:
alter table contact set `email` `email12` //not working

alter table contact set `email` `email12`  varchar (255);  //not working
0
designersxAuthor Commented:
if i use change then query does not works.
0
designersxAuthor Commented:
sir please tell me it is not working
0
termlimitCommented:
ALTER TABLE `table_name` CHANGE `old_column` `new_colum` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'

You might have an issue with some of the variables you are trying to add into the query.  Echo the query to the screen to make sure and try it manually.
0
designersxAuthor Commented:
yes it worked.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.