Answer the question
In order to leave comments, you need to log in
How to compare data array and sql array from database?
A selection is taken from the database and there is an array of data of the form:
Array
(
[id] => 112
[value] => 5412
)
Array
(
[id] => 1451
[value] => 3134
)
Answer the question
In order to leave comments, you need to log in
$cnt = count($answers);
$c = 0;
while ($c < $cnt) {
$id = $answers[$c]["name"];
$value = $answers[$c]["value"];
while($tasks_row = $tasks->fetch_assoc()){
echo $tasks_row['id'];
echo "\r\n";
if($tasks_row['id'] == $task_id){
if($value == $tasks_row['value'])echo "nice";
}
}
$c++;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question