Hi, I insert a record into DB with this code:
- $.post("assets/addspot.php",
- {
- title: vtitle,
- longitude :vlongitude,
- latitude :vlatitude,
- email:vemail,
- stato : vstato,
- user : vuser,
- phone:vphone,
- web : vweb,
- mobile : vmobile,
- image :vimage,
- description : vdescription
- },
- function (data) { // Required Callback Function
- alert( data);
-
- });
my php file is:
- $sql="insert into ....";
- if ($mysqli->query($sql)) {
-
- echo "Succefull Inserted. Good Job!!";
-
- }
- else {
- printf($mysqli->error);
- echo $mysqli->error;
- }
I can insert record in db, but on my web page I can't catch the resul if the record is inserted, if the record is non inserted i see the alert message. Can someone help?
thanks