You’d have to build the SQL dynamically. As a starting point, this would get you the column names you’re seeking.
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name="Foods"
AND table_schema="YourDB"
AND column_name LIKE 'Vegetable%'
More Related Contents:
- How can I properly use a PDO object for a parameterized SELECT query
- MySQL: Select Random Entry, but Weight Towards Certain Entries
- Notice: Array to string conversion in
- SELECT COUNT() vs mysql_num_rows();
- Select from mysql table WHERE field=’$array’?
- unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING error [duplicate]
- How do I set the selected item in a drop down box
- Selecting all fields except only one field in mysql [duplicate]
- select within 20 kilometers based on latitude/longitude
- MySQL ORDER BY rand(), name ASC
- mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource
- How to properly set up a PDO connection
- Using PHP 5.5’s password_hash and password_verify function
- How to do this in Laravel, subquery where in
- I have an array of integers, how do I use each one in a mysql query (in php)? [duplicate]
- Levenshtein: MySQL + PHP
- PHP MySQLI Prevent SQL Injection [duplicate]
- mysql PDO how to bind LIKE
- How to test if a MySQL query was successful in modifying database table data?
- How do i “echo” a “Resource id #6” from a MySql response in PHP?
- Does mysql_real_escape_string() FULLY protect against SQL injection?
- Recursive categories with a single query?
- Using LIKE in bindParam for a MySQL PDO Query [duplicate]
- Password_Hash not working on my PHP login
- Select last 20 order by ascending – PHP/MySQL
- Formatting an SQL timestamp with PHP
- mysqli – fetch_Array error call to a member function fetch_array() on a non-object mysqli [duplicate]
- Backup a mysql database and download as a file
- Is a BLOB converted using the current/default charset in MySQL?
- PHP/MySQL Pagination