I’m not sure if there is a better way to do that, but I checked that this works to get just the name of the columns and is the new mysqli :
$result = mysqli_query($con, 'SELECT * FROM myTable'); while ($property = mysqli_fetch_field($result)) { echo $property->name; }
Related Posts:
- Should I use mysqli_real_escape string() or mysql_real_escape_string() for form data?
- mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- Fatal error: Call to a member function bind_param() on boolean [duplicate]
- MySqli Commands out of sync; you can’t run this command now
- Commands out of sync; you can’t run this command now
- Call to undefined method mysqli_stmt::get_result
- Call to undefined method mysqli_stmt::get_result
- Fatal error: Cannot use object of type mysqli_result
- How to solve “Fatal error: Class ‘MySQLi’ not found”?
- mysqli_select_db() expects parameter 1 to be mysqli, string given
- mysqli::query(): Couldn’t fetch mysqli
- phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user ‘pma’@’localhost’ (using password: NO)
- Warning: mysqli_query() expects at least 2 parameters, 1 given. What? [duplicate]
- Deprecated: mysql_query() [duplicate]
- Object of class mysqli_result could not be converted to string
- Fatal error: Call to a member function fetch_assoc() on a non-object
- Having a problem getting mysqli_query to execute
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given… what I do wrong?
- Call to a member function fetch_assoc() on boolean in
[duplicate] - PHP variables don’t evaluate in the query [duplicate]
- How to set 777 permission on a particular folder? [closed]
- regex match any whitespace
- PHP page redirect
- How do I resolve a HTTP 414 “Request URI too long” error?
- xajax expanding list query
- Data source name not found, and no default driver specified
- what does PHP die() return
- Invalid column count in CSV input on line 1 Error
- how to replace quotation marks with \”
- How do I redirect a page in jQuery?
- Illegal string offset Warning PHP
- What’s the purpose of ini_set() in php? (especially for error reporting)
- why use 0xffff over 65535
- .rar, .zip files MIME Type
- Send email with PHP from html form on submit with the same script
- Forbidden :You don’t have permission to access /phpmyadmin on this server
- How do I run a file on localhost?
- How to call a JavaScript function from PHP?
- Print array to a file
- I have a string with “\u00a0”, and I need to replace it with “” str_replace fails
- Why php tag is not working in html file?
- What’s the use of ob_start() in php?
- PHP: variables in strings without concatenation
- Finding the number of days between two dates
- Trying to get property of non-object in
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- Fix Access denied for user ‘root’@’localhost’ for phpMyAdmin
- Getting connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
- “Cannot send session cache limiter – headers already sent”
- Unable to locate package libapache2-mod-php7
- How to find the date of a day of the week from a date using PHP?
- PHP multidimensional array search by value
- Trying to get property of non-object – Laravel 5
- Can’t use method return value in write context
- nginx: connect() failed (111: Connection refused) while connecting to upstream – after update nginx –
- PHP get domain name
- Object of class DateTime could not be converted to string
- HTTP Error 411, The request must be chunked or have a content length
- Fatal error: Call to undefined function sqlsrv_connect()
- NotFoundHttpException in RouteCollection.php line 161: in laravel 5
- Easy way to password-protect php page
- proper way to logout from a session in PHP
- Html encode in PHP
- file_put_contents: Failed to open stream, no such file or directory
- PHP json_decode() returns NULL with valid JSON?
- PHP $_POST not working?
- PHP cURL HTTP PUT
- Convert timestamp to readable date/time PHP
- PHP sessions that have already been started
- Contact Form 7 – Custom Validation
- How to output JavaScript with PHP
- WRONGTYPE Operation against a key holding the wrong kind of value php
- What is the advantage of using try {} catch {} versus if {} else {}
- Check if URL has certain string with PHP
- Subtracting days, months or years from date using php
- Array of PHP Objects
- “End of script output before headers” in Apache + PHP
- Laravel – Model Class not found
- Strict Standards: Only variables should be assigned by reference PHP 5.4
- mysqlworkbench giving version error on exporting database
- Steam Market API?
- PHP array delete by value (not key)
- PHP mail: Multiple recipients?
- PHP Multiple Checkbox Array
- Session variables not working php
- PHP Warning: PHP Startup: Unable to load dynamic library
- Do I need a !DOCTYPE declaration in a php file with html?
- Get JSON object from URL
- How to push both value and key into PHP array
- Find the last element of an array while using a foreach loop in PHP
- Popup window in PHP?
- How can you use php in a javascript function
- How to bypass (deprecated) reCAPTCHA V1?
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ””)’ at line 2