+ 1
Php question
this is the code <?php $result=$conn->query("select * from tablename where ID='$ID' "); $row=mysqli_fetch_object($result); ?> my question is, do "mysqli_fetch_object" make the $row an object ? if yes, why do we have to make it an object ? why do we have to store the $result in the $row and not use the $result directly instead ,to extract the information ? help ... php newbie here
2 Réponses
0
You are using the Object-oriented method.
you can store it traditionally.
0
I would use $row = $result->fetch_assoc() and get the associative array already returned in the result. Unless there is something requirement to convert to an object don't.
Result contains more than just the data. For example, it also contains a count of returned results: $result->num_rows