PHP array problem, echo shows me array

0

 while (true) {
     $t= "SELECT MAX(id) AS id FROM accidente";
$query2=mysqli_query($db,$t); while($acd[]=mysqli_fetch_array($query2)) $last= current($last_id); $acd_1=current($acd); $ls=(( $last !== false) ? $last : ",  "); $acd2=(( $acd_1 !== false) ? $acd_1 : ",  "); $valores3='("'.$ls.'","'.$acd2.'"),'; $valoresQ3= substr($valores3, 0, -1); $acd_impl="INSERT INTO implicado_acd (id_acd, id_implicado) VALUES $valoresQ3"; $sqlRess1=$db->query($acd_impl) or mysql_error(); $last = next($last_id); $acd_1= next($acd); if($last === false) break; echo "...".$acd;
    
asked by Carlos Alberto Soler Velasquez 16.06.2017 в 04:04
source

2 answers

0

Change the:

echo "..." . $acd;

For a

print_r($acd);

Since your problem is that you are trying to do an echo of an array.

    
answered by 16.06.2017 в 09:09
0

How well does NetVicious comment with:

  • Print_r: Print human-readable information about a variable

  • Var_dump: Shows information about a variable

    print_r($array);    var_dump($array);
    

Both internal php functions will help you display the contents of the array on one line.

    
answered by 16.06.2017 в 11:44