Issue comparing $_SESSION['id'] against the values of an array

so i am at the last step of my script and it is working at 98% and just at the end i cant seem to be able to compare sessionid with the array populated with the winners sliced from the array where all the participants are listed.

`$winners = array_slice($WINNERSID, 0, $num_winners3);
var_dump($winners);
if (isset($winners) && intval($_SESSION[‘id’]) == array_values($winners) && $prizepaid == false) {
}
elseif (isset($winners) && intval($_SESSION[‘id’]) != array_values($winners)) {

exit;

}
else if (isset($winners) && intval($_SESSION[‘id’]) == $winners && $prizepaid == true) {
echo "

for this week you have gained: " . $WINNERSAMOUNT .‘

’;
exit;
}}
?>`

so i tried almost all the array functions and nothing seems to be working or i am taking this the wrong way. i have tried flip array with also using if array_key_exists() but it didnt do neither the isset() is working if in_array doesnt work i might have to try the array_filter() but iam not quite sure about how to handle it. any help would e extremely appreciated. -

A sample of your data and the expected result would be helpful.

long story short my winners array is supposed to return 2 rows of ids that was pulled using a mysqli query then this array have a string but i dont think i am using this string because when i try array_flip function it is returning an error saying that the array isnt defined because the key of the index is like not seen as a string so it refuses to flip.
the data in the array look like this
array(1) { [0]=> array(2) { [0]=> string(2) “24” [1]=> string(2) “25” } }

I am not interested in your attempted solution. I want to know what the real problem is by looking at a real data sample and what you expect out of it.

Now that you have provided a sample array, what are you expecting from it?

simply that the conditional block validate using this array by comparing with the $_SESSION[‘id’]

Lets back up. Show me an SQL dump of your DB table with sample data and your query.

i am really new to programming could you tell me how to do the DB dump?

Are you using any third party tools to manage the DB or do you just have command line access?

i am using phpmyadmin

If your query is getting data from more than one table you should just export the entire DB , else just the relevant table. PM the export to me.

the query itself doesnt pull data from multiple table simply the id coming from the users info table is linked with the participation id from this script does it matter or in this case it is only one table needed?

Just dump the whole thing.

also i cant find the pm to send you in pm can i attach the file here , i dont really mind if people see the database i will change everything once i am done

Post it here then. If you click my name, there should be a “message” button that pops up.

i see no message button appearing, maybe i am not high level enough or something? and it seems like i cant attatch a file on here … its only hyperlinks

Then just paste it in

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `phplogin`
--

-- --------------------------------------------------------

--
-- Table structure for table `donationclashdetails`
--

CREATE TABLE `donationclashdetails` (
  `dcid` tinyint(1) NOT NULL DEFAULT 1,
  `prizepaid` tinyint(1) NOT NULL DEFAULT 0,
  `participationid` bigint(20) NOT NULL,
  `usernames` varchar(50) NOT NULL,
  `donationamount` double NOT NULL,
  `totaldonated` double NOT NULL,
  `totalpifcoincollected` double NOT NULL,
  `totalparticipant` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `donationclashdetails`
--

INSERT INTO `donationclashdetails` (`dcid`, `prizepaid`, `participationid`, `usernames`, `donationamount`, `totaldonated`, `totalpifcoincollected`, `totalparticipant`) VALUES
(1, 0, 26, 'test1', 5000, 5000, 5000, 1),
(1, 0, 27, 'test2', 2500, 2500, 2500, 1),
(1, 0, 28, 'test3', 330, 330, 330, 1),
(1, 0, 29, 'test4', 7000, 7000, 7000, 1),
(1, 0, 30, 'test5', 500, 500, 500, 1),
(1, 0, 31, 'test6', 1500, 1500, 1500, 1),
(1, 0, 32, 'test7', 1500, 1500, 1500, 1),
(1, 0, 33, 'test8', 4000, 4000, 4000, 1),
(1, 0, 47, 'test23', 250, 250, 250, 1),
(1, 0, 46, 'test22', 75, 75, 75, 1),
(1, 0, 45, 'test20', 350, 350, 350, 1),
(1, 0, 43, 'test18', 250, 250, 250, 1),
(1, 0, 42, 'test17', 330, 330, 330, 1),
(1, 0, 41, 'test16', 450, 450, 450, 1),
(1, 0, 40, 'test15', 1000, 1000, 1000, 1),
(1, 0, 39, 'test14', 75, 75, 75, 1),
(1, 0, 38, 'test13', 600, 600, 600, 1),
(1, 0, 37, 'test12', 560, 560, 560, 1),
(1, 0, 36, 'test11', 750, 750, 750, 1),
(1, 0, 35, 'test10', 5000, 5000, 5000, 1);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

there is one column that i am not using at all but it doesnt matter it is to be removed

Now tell me exactly what data you want from the table.

i dont need any data i already have it pulled in my script and then the array is sliced to select the winners row i only need to be able to read the data from that sliced array to compare the values with the $_SESSION[‘id’]. i can put my whole script if you wanna see.