Jump to content

[SOLVED] DB fields select more than one


timmah1

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)";

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.