squirrelworks

PHP Structures & Diagrams



Pseudocode

- createConn is established elsewhere with the required db name and password - represented here by $conn.
- html table opener and headers are printed
- $query contains the sql code to be ran
- use mysqli_query to attempt a run. Here we find out whether there are errors. This could fail due to php or mysql syntax/logic bugs.
- use pre-built error-handling my_sqli_error() if fail. If no failure, then there must be at least 1 row containe din $result now, although there could be multiple rows. $result represents an associative array of row data.
- while $result contians data.. echo that data through the table loop, until no more data exists at which point the array of rows was successfully read/echo'd, and we're done.