Search the Community
Showing results for tags 'app inventor'.
-
Hi all, I am new here and was looking for some help.I am new to programming java and php using app inventor and have no experience with MYSQL although i have been educated on theory and concepts. Problem: User fills out for on appinventor app form and clicks submit button. This app talks with my php script below (Dont know how i did it but coudnt get anyones elses to work so i wrote my own from PHP scratch) and input the userdata one PHPscript or "form field" at a time causing the database to look like this. Firstname Lastname ___________________RID___ John NULL 1 NULL Smith 2 What i need it to do is dump all the form data at once or keep the session with the same unique ID or RID?(Not sure if i know what im talking about here). This is the script that takes the info from my appinventor userinput and plants it in mySQL data base under the appropriate field. problem is when second script is ran(idont know php very well) it puts the lastname in the database but it doesnt put it at the same key or unique id as the first name? --------------------------------------------------------------------------------------------------------------------------------------------------------- <?php $FirstName = $_GET['FirstName']; $con=mysqli_connect("XXXXXXXXXX","XXXXXXXX","XXXXXXXX","XXXXXXX"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_query($con,"INSERT INTO SmallBook (FirstName) VALUES ('$FirstName')"); mysqli_close($con); ?> ___________________________________________________________ second script ----------------------------------------------------------------------------------------------- <?php $LastName = $_GET['LastName']; $con=mysqli_connect("XXXXXXXXXX","XXXXXXXX","XXXXXXXX","XXXXXXX"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_query($con,"INSERT INTO SmallBook (LastName) VALUES ('$LastName')"); mysqli_close($con); ?> Thanks in advance, ~James PS: not sure if it helps but my scripts are save as .php5