©
本文档使用
php.cn手册 发布
(PHP 4, PHP 5)
odbc_do — 别名 odbc_exec()
此函数是该函数的别名: odbc_exec() .
[#1] scottmweaver [2007-06-01 15:27:31]
Hey guys,
I used the following code to run normal double quotes inside my SQL queries. Hopefully this will save someone else a headache or two-
<?php
function query($query, $conn)
{
odbc_do($conn, 'SET QUOTED_IDENTIFIER OFF');
return odbc_do($conn, $query);
}
?>
[#2] phil.nyc [2006-12-04 07:23:08]
To clear up: the SQL standard requires strings to be inside single quotes: 'string'. It simply does not accept double quotes for this purpose.
Furthermore, in PHP, you can have a single quote inside double quotes: "select a from b where c = 'string'" without the need to escape.
[#3] yashkhopade at hotmail dot com [2003-07-10 03:53:33]
i have use this function so many times. it works well for my requirements. ok well done...
<?php
$sqlstr="SELECT bill_no FROM SCROL";
$queryresult=odbc_do($conn,$sqlstr);
odbc_fetch_row($queryresult,$bills);
// if we want to access the records
// then we have to write the following code
echo $bills[0];
?>
the out put for this will:
1
which is actullay first record of resultset.