Skip to first unread message

Werner Pelser

unread,
Aug 6, 2017, 3:03:04 PM8/6/17
to MIT App Inventor Forum
Hi.

I am new to app inventor.

I am using XAMPP with the sql database to insert that from app inventor to sql with php

My PHP script as follows.

<?php

$connect=mysqli_connect("localhost","root","","assetregister");

$nametxt=$_POST["nametxt"];
$brand=$_POST["brand"];
$model=$_POST["model"];
$supplier=$_POST["supplier"];
$category=$_POST["category"];
$serial_number=$_POST["serial_number"];


mysqli_query($connect,"INSERT INTO assetregister(name,brand,model,supplier,category,serial_number) VALUES ('$nametxt','$model','$supplier','$category','$serial_number')");


?>

see attached my blocks.

Okay the issues as follows.

if i ad all the information required and hit the submit button it goes through the steps and shows the message asset added but when going to my xampp sql database i do note see the line added. can you please assist me.

i tried the following

I run the php script with valeus in my browser and it did enter the values.
i entered the url of my server.
i changed my local ip to listen on port 80
i used localhost
i use my ip address.
i installed the app on my note 5 and used my mobile data.

But still i can not get it to insert the data into my database.

Thanks Werner
blocks.PNG

Taifun

unread,
Aug 6, 2017, 4:06:46 PM8/6/17
to MIT App Inventor Forum
try the example script and blocks from here
and after you got this running, adjust it to your needs

Taifun
Reply all
Reply to author
Forward
0 new messages