MySQL Forums
Forum List  »  Russian

Как получить данные из базы
Posted by: Dominique Jann
Date: March 24, 2009 04:23PM

делаю так, код на VB, использую библиотеку libmysql

Dim hMysql as Long
Dim hQueryResult as Long
Dim hQueryRow as Long

hMysql = mysql_init(0)
call mysql_real_connect(hMysql, "localhost", "apt", vbNullString, "test", 3306, vbNullString, 0)
call mysql_real_query(hMysql, "select * from m_test", 20)
hQueryResult = mysql_store_result(hMysql)
hQueryRow = mysql_fetch_row(hQueryResult)
Do While hQueryRow <> 0
num_fields = mysql_num_fields(hQueryResult) - 1
Do While num_fields >=0
'string fields
num_fields = num_fields - 1
Loop
hQueryRow = mysql_fetch_row(hQueryResult)
Loop
Call mysql_free_result(hQueryResult)
mysql_close (hMysql)

все отлично работает, только никак не пойму как получить данные по колонкам, подскажите как это сделать



Edited 2 time(s). Last edit at 03/24/2009 04:29PM by Dominique Jann.

Options: ReplyQuote


Subject
Views
Written By
Posted
Как получить данные из базы
5641
March 24, 2009 04:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.