RE: [PHP-WINDOWS] ODBC problem
| From: | Herman Stevens | Date: | Sun, 11 Jun 2000 17:47:37 +0000 |
| Subject: | RE: [PHP-WINDOWS] ODBC problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-397@lists.php.net to get a copy of this message | ||
Try
$username = addslashes($username)
before the insert.
> -----Oorspronkelijk bericht-----
> Van: fredo [mailto:fredo@pandora.be]
> Verzonden: zondag 11 juni 2000 15:27
> Aan: php-windows@lists.php.net
> Onderwerp: [PHP-WINDOWS] ODBC problem
>
>
> Hi,
>
> <?
> ....
> $db_query = "INSERT INTO UserInfo (Name, RollNumber, Email,
> Account, Type)
> ".
> "VALUES ('$username', '$rollnumber',
> '$email',
> '$accountname', '$accounttype')";
> $db_result = odbc_exec($db_conn, $db_query);
> ...
> ?>
>
> This works fine till one of my fields contain a value like
>
> $username = D'hooghe
>
> The problem is the <'> in the value. Anyone got a nice solution howto make
> this works and make the ODBC succeed.
>
> Greetings.
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>