Hi, I hope you guys can help me out. I only know basic PHP and also SQL. I haven't tried using connecting database yet.
My problem is that I'm trying to INSERT a data into an existing table using access but when it reaches $rs = odbc_exec(); it returns an error that the query was empty.
Here is the code:
$conn=odbc_connect('trial','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql = "INSERT INTO Data (FirstName, LastName, BusinessName)
VALUES ('$fname', '$lname', '$bname')";
$rs=odbc_exec($sql, $conn);
$rs = @odbc_exec($conn,$sqlstring);
if (!$rs)
{
echo "An error has occured. Please try again", odbc_errormsg($conn);
}
else
{
echo "The record was successfully inserted.";
}
odbc_close($conn);
and here is the error:
I really hope you could help me out.
Thanks.