unrelenting Posted March 22, 2009 Share Posted March 22, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/150599-solved-column-wildcard/ Share on other sites More sharing options...
Maq Posted March 22, 2009 Share Posted March 22, 2009 Do you mean you want to select all values in a specific column that begin with 'winner'? SELECT * FROM table WHERE field LIKE 'winner%'; Quote Link to comment https://forums.phpfreaks.com/topic/150599-solved-column-wildcard/#findComment-791055 Share on other sites More sharing options...
unrelenting Posted March 22, 2009 Author Share Posted March 22, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/150599-solved-column-wildcard/#findComment-791057 Share on other sites More sharing options...
unrelenting Posted March 22, 2009 Author Share Posted March 22, 2009 Thanks. I found another way around it. Quote Link to comment https://forums.phpfreaks.com/topic/150599-solved-column-wildcard/#findComment-791066 Share on other sites More sharing options...
Maq Posted March 22, 2009 Share Posted March 22, 2009 Thanks. I found another way around it. Sure, sorry I just don't think I understood exactly what you wanted. Please mark as [sOLVED] if you're done, and maybe post the solution in case anyone else wants to reference it. Quote Link to comment https://forums.phpfreaks.com/topic/150599-solved-column-wildcard/#findComment-791069 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.