Changes between Version 4 and Version 5 of Docs/825gen2/Dev/Networking/PHP


Ignore:
Timestamp:
11/09/23 13:04:28 (12 months ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/825gen2/Dev/Networking/PHP

    v4 v5  
    5959It may also be helpful to use browser "Developer tools" selection to view the generated html code.
    6060
     61[[Image(825webdevtools.png)]]
     62
     63PHP can also be used to read SQLite databases.
     64
     65{{{
     66root@imx8mq-var-dart:/usr/share/apache2/default-site/htdocs# cat testsqlite.php
     67<!DOCTYPE html>
     68<html lang="en">
     69<head>
     70  <title>825 SQLite Test</title>
     71</head>
     72<body>
     73
     74<?php
     75$db = new SQLite3('/mnt/nand/apps/ids/ids.db3');
     76
     77$results = $db->query('SELECT truck_name,tare FROM trucks');
     78echo '<table><tr><th>Truck ID</th><th>Tare</th></tr>';
     79while ($row = $results->fetchArray()) {
     80   $truckid = $row['truck_name'];
     81   $tare = $row['tare'];
     82   echo '<tr><td>' . $truckid . '</td><td>' . $tare . '</td></tr>';
     83}
     84echo '</table>';
     85?>
     86
     87</body>
     88</html>
     89}}}
    6190
    6291
     92
     93
     94