Here is the code.
...
while( odbc_fetch_row( $cur ) ) {
$name = odbc_result( $cur, 1 );
...
}
$name = ereg_replace ("'", "''", $name);
$sql = "SELECT * from dbname where name='$name'";
$curtopic= odbc_exec( $cnx, $sql );
echo $name;
I don't see any reason why the result showed two single quotes, like O''Neil.
Thanks