PHP
·
发表于 5年以前
·
阅读量:8312
$connection = int odbc_connect(string dsn, string user, string password)½¨Á¢Êý¾Ý¿aÁ¬½Ó£¬
$query_string = "²eѯ¼Ç¼µÄÌo¼þ"
È磺$query_string = "select * from table"
ÓÃ$cur = int odbc_exec(int connection_id, string query_string)¼iË÷Êý¾Ý¿a£¬½«¼Ç¼¼¯*ÅÈe$cur±aÁ¿ÖС£
ÔÙÓÃwhile (odbc_fetch_row($cur)){
$var1=odbc_result($cur,1);
$var2=odbc_result($cur,1);
...
}
¶ÁÈ¡odbc_exec()*µ»ØµÄÊý¾Ý¼¯$cur¡£
×iºoÊÇodbc_close(int connection_id)¹Ø±ÕÊý¾Ý¿aµÄÁ¬½Ó¡£
odbc_result()º¯ÊýÊÇÈ¡µ±Ç°¼Ç¼µÄÖ¸¶¨×Ö¶ÎÖµ¡£