I have recently started using Zend Studio which has reported as warning the following type of code:
$q = query(\"select * from some_table where some_conditio
Nay my friends all assignments in the condition generate this warning. I do not want to turn this off completely, as = instead of == is a syntax error i am prone to. As for question of why it is necessary, I will use an example from the PHP Manual. This is from the section on the "MySQL improved" extensions or mysqli:
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
if ($result = $mysqli->query($query)) {
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
}
unfortunately, I have developed my database functions using this technique and am trying to use them in Zend Studio. This error is popping up enough times to be a real pain. I will rephrase with the suggestions here, as I value unambiguous code, however I am also going to pop over to the PHP manual and suggest they change the example to use the better style. Perhaps some of you could do the same and we could improve the documentation?!