0

I created a small table with one entrey with three columns but I can't get it to show up in my php code. I'm not really doing anything with the form variables right now I'm mainly focused on getting the code below that to query my SQLite DB.

<?php
// get variable from html form
$fName = $_POST['fname'];
$lName = $_POST['lname'];
$address = $_POST['email'];

$db = sqlite_open('./ET')
{
        $result = sqlite_query($db, 'select * from customers');
        echo $result;
}
?>

Edited by pritaeas: Closed.

3
Contributors
7
Replies
29
Views
3 Years
Discussion Span
Last Post by pritaeas
0

Line 8, change it to:

if($db = sqlite_open('./ET'))

I suppose ET is the name of the database file.

0

I've revised the code but it's still showing a blank page. And yes, et is the database.

<?php
echo "<html>";

// get variable from html form
$fName = $_POST['fname'];
$lName = $_POST['lname'];
$address = $_POST['email'];

if($db = sqlite_open('./et', 0666, "$error_message"))
{
$result = sqlite_query($db, 'select * from customers');
echo "$result";
}
echo "hello world!";
echo "</html>";
?>