I am fetching data from product detail table but i don't want to fetch all the columns from the table as i want to make a dynamic product detail page which will display the data directly from the table whenever we add a new column so that we don't have to make any changes in the code.
You have a horrible table structure. Try something like this...
id, field_name, data
CREATE TABLE `fieldstore` (
`id` int(11) NOT NULL,
`field_name` varchar(100) NOT NULL,
`field_data` varchar(200) NOT NULL
)
Example data: 1, "blend", "bamboo" (The 1 is of course auto-increment).
This way, you can have an unlimited number of field names without having to alter your table structure every time you wanted to add a new column.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.