Hello,
I usually use MySQL for my databases but I have to use, for one of my client, a data driven web site using MS-Access97.
The following code inserts a new row in an Access97 table ($descr is a parameter passed from another page by using a form) :
<form>
<?
// connexion ?la DB
if (!$link = odbc_connect ("testdb", "vincent", "mypwd"))
{
echo "DB connexion failed !";
exit();
}
$query = "INSERT INTO test (descr) VALUES ('$descr');";
if (!($result_query = odbc_exec($link, $query)))
{
echo "Cannot query the DB !";
exit();
}
?>
</form>
If I want to add a text containing a quote "'", I get a "syntax error" message.
This code does work with MySQL.
Please help me. Many thanks.
Vincent.
I usually use MySQL for my databases but I have to use, for one of my client, a data driven web site using MS-Access97.
The following code inserts a new row in an Access97 table ($descr is a parameter passed from another page by using a form) :
<form>
<?
// connexion ?la DB
if (!$link = odbc_connect ("testdb", "vincent", "mypwd"))
{
echo "DB connexion failed !";
exit();
}
$query = "INSERT INTO test (descr) VALUES ('$descr');";
if (!($result_query = odbc_exec($link, $query)))
{
echo "Cannot query the DB !";
exit();
}
?>
</form>
If I want to add a text containing a quote "'", I get a "syntax error" message.
This code does work with MySQL.
Please help me. Many thanks.
Vincent.