Creating a comparison function in PHP

Basically im trying to compare 5 lots of results that are pulled from the database with a seperate table in my database to see if they’ve already been used and if they have Regenerate the codes

i’ve wrote this

[php]
#Comparison SQL
$uni = array($result, $result1, $result2, $result3, $result4);
$comp = “SELECT Already_Selected FROM AL_S”;
$compare = mysqli_query($conn, $comp);
if ($uni[0] === $compare) {
mysqli_query($conn, $sql);
} else {
echo “cant do it”;
};
[/php]

but apparently don’t work i am new to this so how would i go about doing this

[php]$uni = array($result, $result1, $result2, $result3, $result4);[/php]

Are you populating $uni array fron 5 different queries?

Whatever your doing, your doing it wrong. On top of that, if all the data is in the DB you can do what ever it is your trying to do in SQL.

A better explanation of what you are doing overall and not how you think it needs to be done will be helpful to help you.

Sponsor our Newsletter | Privacy Policy | Terms of Service