@Freeranger said:
Parse error: syntax error, unexpected ‘array_unique’ (T_STRING) in /home/vol11_3/epizy.com/epiz_21490173/htdocs/test_update/fetch.php on line 45
If I’m reading between the lines in the official documentation, the statement within the if structure must be on the next line.
So this doesn’t work:
if(mysqli_num_rows($result) > 0) array_unique($data);
But this does:
if(mysqli_num_rows($result) > 0)
array_unique($data);
This should work as well:
if(mysqli_num_rows($result) > 0) { array_unique($data); }
And, for the sake of completion, this is the only right format dictated by the PSR-2 coding style guide:
if (mysqli_num_rows($result) > 0) {
array_unique($data);
}
And remember that while Java and PHP are both inspired by C, their syntax is not the same.