Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get the colomn name of table using MySql

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 258
    Comment on it

    Hello Reader's, If you have to get the only names of columns of table then see the code below:-

    You can use following query for MYSQL:-

    SHOW columns FROM your-table; Below is the example code which shows How to implement above syntax in php to list the names of columns:

    $sql = "SHOW COLUMNS FROM user";  //here user is my table 
    $result = mysqli_query($conn,$sql);
    while($row = mysqli_fetch_array($result)){
    echo $row['Field']."<br>";
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: