Jump to content

Recommended Posts

I've looked on google for an answer to this since last night, and I can't find any.

 

Can anybody help me out?

I need to find everything from the db where a table will equal more than one.

I have this

$package1 = implode(",", $_POST['pack']);
echo $package1;
$sql = "SELECT * FROM dailypicks1 WHERE sport = '$sport' AND active = '$active' AND package = '$package1'";

 

It echo's out properly, but it's not selecting both from the field package.

 

How is this done?

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/138335-solved-db-fields-select-more-than-one/
Share on other sites

$package1 = "'".implode("','", $_POST['pack'])."'"; // string
#$package1 = implode(",", $_POST['pack']); // numbers

echo $package1;
$sql = "SELECT * FROM dailypicks1 WHERE sport = '$sport' AND active = '$active' AND package IN ($package1)";

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.