I’ve been using mysqli queries recently, but their use isn’t very intuitive for me. For example, let’s say I have a table with three entries:
Table A
-Column 1
-Value1
-Value2
-Value3
If I did
$query = $mysqli->query("SELECT Column1 FROM Table A);
I would expect that $query would hold the values for that column, but I have to follow it with something like
while ($value = $query->fetch_row()){
echo $value;
}
I just would like to know an example of when you would want to use a query result as a query result, and not just to access the values that it returns. Sorry If I just ask this to get a better grasp of the language, but I find that understanding the paradagim of a language really helps in using it better.