Описание
Эта функция является псевдонимом: odbc_exec().
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Уровни абстракции
- ODBC (Unified)
- odbc_autocommit
- odbc_binmode
- odbc_close_all
- odbc_close
- odbc_columnprivileges
- odbc_columns
- odbc_commit
- odbc_connect
- odbc_cursor
- odbc_data_source
- odbc_do
- odbc_error
- odbc_errormsg
- odbc_exec
- odbc_execute
- odbc_fetch_array
- odbc_fetch_into
- odbc_fetch_object
- odbc_fetch_row
- odbc_field_len
- odbc_field_name
- odbc_field_num
- odbc_field_precision
- odbc_field_scale
- odbc_field_type
- odbc_foreignkeys
- odbc_free_result
- odbc_gettypeinfo
- odbc_longreadlen
- odbc_next_result
- odbc_num_fields
- odbc_num_rows
- odbc_pconnect
- odbc_prepare
- odbc_primarykeys
- odbc_procedurecolumns
- odbc_procedures
- odbc_result_all
- odbc_result
- odbc_rollback
- odbc_setoption
- odbc_specialcolumns
- odbc_statistics
- odbc_tableprivileges
- odbc_tables
Коментарии
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.
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.
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
/**
* Query Function
* Allows quoted queries to be sent to SQL
*/
function query($query, $conn)
{
odbc_do($conn, 'SET QUOTED_IDENTIFIER OFF');
return odbc_do($conn, $query);
}
?>