Hey all,

Im hoping someone can shed some light on this for me:

Im running PHP 4.31 on RH Advanced Server 2.1

I am connecting, to M$SQL Server 2000  using FreeTDS -- with Sybase support,
and Im stumped on 1 thing:

CODE:
============================================================================
====================
<?php

$ccode = $_POST['ccode'];
$cname = $_POST['cname'];
$cstreet = $_POST['cstreet'];

include("includes/connect.php");
$iqry_clients = mssql_query("INSERT INTO Clients
(client_code,client_name,client_street) VALUES
('$ccode','$cname','$cstreet')");

mssql_close($conn);

?>
============================================================================
====================

The above code works fine, except when one of the fields e.g client_name -
Has a quoted string or an apostrophe in it, it just spews the following
error:

Warning: Sybase error: Line 1: Incorrect syntax near 's'. (severity 15) in
/var/www/html/clients/pages/add_client.php on line 17

Has anyone experienced this, and if so know of a possible solution?? I have
used addslashes() etc but still no joy.

Thanks in advance.

Craig



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to