i am trying to insert data to my online database using following php script
i am getting following error in log
<b>Parse error</b>: syntax error, unexpected ';' in <b>/srv/disk2/3373050/www/saeedhassan.atwebpages.com/i.php</b> on line <b>20</b><br />
The B4J code that i am running to insert data is following
B4X:
<?php
$conn = new mysqli("fdb23.awardspace.net", "3373050_restaurant", "abc123", "3373050_restaurant");
if ($conn->connect_error) {
die("ERROR: Unable to connect: " . $conn->connect_error);
}
echo 'Connected to the database.<br>';
$id = $_REQUEST('id');
$name = $_REQUEST('name');
$price = $_REQUEST('price');
$query = $conn->stmt_init() ;
if ( $query->prepare("INSERT INTO menuitems SET itemid = ?, itemname = ?, itemprice = ?") {
$query->bind_param('isi',$_REQUEST['id'],$_REQUEST['name'],$_REQUEST['price']) ;
$query->execute() ;
}
if($conn->query($sql)===TRUE){
echo "SUCCESS!";
}else{
echo "ERROR"
}
$conn->close();
?>
<b>Parse error</b>: syntax error, unexpected ';' in <b>/srv/disk2/3373050/www/saeedhassan.atwebpages.com/i.php</b> on line <b>20</b><br />
The B4J code that i am running to insert data is following
B4X:
Dim id As Int
Dim name As String
Dim price As Int
id = Txtid.Text
name = Txtname.Text
price = Txtprice.Text
Dim j As HttpJob
j.Initialize("INSERT", Me)
j.Download2("http://saeedhassan.atwebpages.com/i.php", Array As String ("id", id, "name", name, "price", price))
Wait For (j) jobdone (j As HttpJob)
If j.Success = True Then
Log(j.GetString)
Else
Log("Error: " & j.ErrorMessage)
End If
j.Release