WOLFGANGHASH
New member
0
0%
3
Months of Service
0%
I am trying to use sqlite with PHP. I have managed to fetch manually added data, but I am having trouble with inserting new data. The code in the image is working fine, it prints 'ok', but it doesn't insert the data. I am working locally on localhost. Here is the code snippet:
```
$db = new SQLite3("selam.db");
if (isset($_POST['lk'])){
$statement = $db->prepare("INSERT INTO notify(model_id, konu) VALUES ('3', 'selam')");
if ($statement) {
echo 'ok';
} else {
echo 'error';
}
}
```
```
$db = new SQLite3("selam.db");
if (isset($_POST['lk'])){
$statement = $db->prepare("INSERT INTO notify(model_id, konu) VALUES ('3', 'selam')");
if ($statement) {
echo 'ok';
} else {
echo 'error';
}
}
```