Solved

this query is not working , is it right?

Posted on 2009-07-15
9
217 Views
Last Modified: 2012-05-07
$sql="alter table `$tname` change `$old_field_name` `$field_name1` , `$old_field_type` `$dropdown` ";
0
Comment
Question by:designersx
  • 6
  • 2
9 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24866536
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
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 50 total points
ID: 24866544
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
 

Author Comment

by:designersx
ID: 24866594
i am using mysql database and php.

i want to write the query for 2 fields.
0
 

Author Comment

by:designersx
ID: 24866654
i wrote this query in mysql database to check if it runs but it does not runs.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:designersx
ID: 24866666
alter table contact set `email` `email12` //not working

alter table contact set `email` `email12`  varchar (255);  //not working
0
 

Author Comment

by:designersx
ID: 24866671
if i use change then query does not works.
0
 

Author Comment

by:designersx
ID: 24866685
sir please tell me it is not working
0
 
LVL 4

Expert Comment

by:termlimit
ID: 24866694
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
 

Author Closing Comment

by:designersx
ID: 31604112
yes it worked.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now