http://php.net/manual/en/function.mysql-num-fields.php
$result = mysql_query("select * from table");
echo '<tr>';
for ($i = 0; $i < mysql_num_fields($result); $i++) {
echo "<th>".mysql_field_name($result, $i)."</th>";
}
echo '</tr>';
More Related Contents:
- Laravel one to many relation with a one to one relation
- which is better every user have a table or just a row [closed]
- I am seeing this error on submitting form Error: query was empty [closed]
- How to convert the json image url string into Bitmap image to display images in android application
- save user images in MYSQL database by which method? [closed]
- How to use multiple databases in Laravel
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- Many-to-many relationships examples
- PDO get the last ID inserted
- Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in
- Show values from a MySQL database table inside a HTML table on a webpage [duplicate]
- Warning: mysqli_connect(): (HY000/1045): Access denied for user ‘username’@’localhost’ (using password: YES)
- How can I store and retrieve images from a MySQL database using PHP?
- How to upload images into MySQL database using PHP code
- Importing CSV data using PHP/MySQL
- MySQL check if a table exists without throwing an exception
- How to store file name in database, with other info while uploading image to server using PHP?
- Mechanisms for tracking DB schema changes [closed]
- PDO::PARAM for type decimal?
- How to store an array into mysql?
- Selecting a float in MySQL
- Get all child, grandchild etc nodes under parent using php with mysql query results
- phpmyadmin automatic logout time
- How to execute raw queries with Laravel 5.1?
- Saving images in database mysql
- MySQL skipping first row
- PHP – Secure member-only pages with a login system
- mysql injection damages?
- How do I save PHP session data to a database instead of in the file system?
- Mysqli multiple row insert, simple multi insert query [duplicate]