top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to change the name of a column of a table?

0 votes
561 views
How to change the name of a column of a table?
posted Jun 25, 2014 by Karamjeet Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

The following query will change the Column name of your table:

ALTER TABLE table_name CHANGE old_column_name new_column_name.

answer Jun 26, 2014 by Mohit Sharma
+1 vote

ALTER TABLE Table_name RENAME COLUMN column_name TO new_column_name;

answer Jan 5, 2017 by Ajay Kumar
Similar Questions
0 votes
for($i=0;$i<=feof($getdata);$i++)
{
if (filter_var($data[$i][1], FILTER_VALIDATE_EMAIL)){
echo $data[$i][1];
$email=$data[$i][1];
$conn = mysqli_connect($dbhost,$dbuser,$dbpass, $dbname);
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
$sql ="INSERT INTO promo_user (uid,name,email) VALUES (,'', '$email')";
mysqli_query($sql,$conn);
mysqli_close($conn);

I am using the above code but there is something wrong with it,whenever i run the code the echo is working fine but the content does go into sql table

Please help

...