I am trying to pass a value of my fix to my query but at the moment of doing it it says to me:
Array to string conversion
My fix comes from a function in a file called functions.php
It is the first value of my array that I want to pass to the query of my functions.php file
I have a variable that collects the result of my main function:
$emit = obtener_mensajes($conexion, $us);
This is where I want to insert my query and the variable:
<?php
$query = "SELECT * FROM messages WHERE idEmitter IN ($us, $emit[0]) AND idReceiver IN ($emit[0], $us) ORDER BY sent ASC" ;
$run = $conexion->query($query);
while ($row = $run->fetch(PDO::FETCH_ASSOC)):
//var_dump($row);
?>
This is my arrangement
array(1) {
[0]=>
array(10) {
["idEmitter"]=>
string(1) "1"
[0]=>
string(1) "1"
}
}