nickRSA
-
Posts
3 -
Joined
-
Last visited
Posts posted by nickRSA
-
-
1 hour ago, requinix said:
If you're using PDO and SQLite then why is there calls to mysqli_query and mysqli_close in there?
I have tried many things to make it work, this was just the most recent attempt as I've been told that you can query both DBs with SQL. Having worked with mysql before, I was hoping the code would apply here too.
-
Good day
Im having some issues trying to send my html table data to my sqlite DB.
My table data is randomly generated. It pulls names and surnames from a JS array to create an individual. (not sure if this is relevant but just thought I might add it). Could anyone assist?<?php if(isset($_POST['output'])) { $firstname = $_POST["random-fname"]; $surname = $_POST["random-sname"]; $name_no = array_combine($firstname, $surname); $db = new PDO('sqlite:test22.db'); if(!$db) echo "not connected"; foreach ($name_no as $randomUser => $user) { echo "$randomUser -> user"; $res = mysqli_query($db, "INSERT into info(name,surname) values('$firstname','$surname')"); if(!res) echo "Record not inserted"; else echo "INSERTED"; } mysqli_close($db); } ?>
Insert Randomly Generated name and surname into sqlite DB.
in PHP Coding Help
Posted
Good day guys, having some issues getting the following to work:
The video tutorial I followed made use of "%s" but for some reason my browser tells me the syntax is incorrect. I am a bit lost, as I am relatively new to PHP as a whole.
Any assistance would be appreciated.
Cheers!