Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.