I have a very small sqlite3 database with one row consisting of three columns but I can get the page to display the row to save my life. So far all I've been able to get the page to display is the first column of the one row that's in my DB using querySingle and echo $result
. $entry
doesn't seem to be doing anything neither does the bottomw while loop. Any ideas. All I want to do here is display the one row that's in my DB to the screen.
<?php
echo "<html>";
echo "<body>";
// get variable from html form
//$fName = $_POST['fname'];
//$lName = $_POST['lname'];
//$address = $_POST['email'];
$db = new SQLite3('./et.sqlite3', SQLITE3_OPEN_READWRITE);
if(!$db)
{
echo "Could not open/access DB";
}
else
{
echo "Database is here";
//$result = $db->query('select * from customers');
//var_dump($db->querySingle('select * from customers'));
//print_r($db->querySingle('select * from customers', true));
$result = $db->querySingle('select * from customers');
echo $result;
$query = sqlite_query($db, 'select * from customers');
while($entry = sqlite_fetch_array($query, SQLITE_NUM))
{
echo $entry[0]." ".echo $entry[1]." ". echo $entry[2];
}
$i = 0;
while($i < strlen($result))
{
echo $result[$i];
$i++;
}
}
echo "</body>";
echo "</html>";
?>