Jump to content

[SOLVED] column wildcard?


unrelenting

Recommended Posts

Is there a way to select certain columns with a wildcard included. % doesn't work.

 

For example, I want to select all columns that begin with 'winner'. I have several columns that are like this (winner1_2, winner1_3, winner1_4, winner 2_2 etc.)

 

How could I best just grab the contents of those columns, There is only one row involved. I need to put it into an array for comparisons purposes with the contents of a separate table.

Link to comment
https://forums.phpfreaks.com/topic/150599-solved-column-wildcard/
Share on other sites

Do you mean you want to select all values in a specific column that begin with 'winner'?

 

SELECT * FROM table WHERE field LIKE 'winner%';

 

I need to select the value for each column whose name begins with 'winner'. Only the columns that begin with winner as I don't need the value from other columns included into the array.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.