What does this code do?
13 minutes ago, Emil_Loenneberg SE said:Hi. I'm having a hard time understanding what this code does.
Well I think I'm back again
聽
while($row = mysqli_fetch_assoc($result))
This part will loop through the data from DB row by row, in the form of an array. $result seems to be having data previously fetched from a DB.
聽
This part:
will take the first row in the information from the DB, and then uses "<th>" to format it as 'Table Header', I think it is something like making the first row聽bold.聽
This will essentially combine the rest of the data from the DB into a table. The tabular data is stored into the variable 'table'.
This will check if the data from the DB is empty. If it is, It will throw a table which has "No results" as the output. Else, it will output the table.
聽
TL;DR, just converting the data from a Database into a tabular format.
聽
Hope this helps!
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now