Jump to content

Arrays in a mysql statement


OutOfInk

Recommended Posts

I havew populated $llec as an array with nine teams and i need to extract all users who have bet on any of these options, ive tried everything i can think of so far so if someone has a solution would be awesome.

 

 

Ive tried a for () statement as well with no luck.

 

 

$i = 0;

$puntBets = mysql_fetch_row(mysql_query("SELECT `name` , `bet` FROM `tablebets` WHERE `placed_on` = '$llec[$i]' AND `round` = '$round'"));

$i++;

Link to comment
Share on other sites

Thanks mac_qyver,

 

I've imploded them as so $imp = implode("', '", $llec);

 

But mysql is still saying theirs an error with my array data

 

SELECT `name` , `bet` FROM `table` WHERE `round` = '$round' AND `placed_on` IN ('Richmond','Carlton','Port Adelaide','GWS Giants','Hawthorn','West Coast','North Melbourne','Draw','Draw') 

 

I run this as a test and it said theirs a error

Link to comment
Share on other sites

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.