Page 1 of 1

libmysql.dll - fieldname of column

Posted: Wed Jan 25, 2006 11:33 am
by Rico
Hello,

can someone please give me an example, how i can get the name of an field in mysql by using the libmysql.dll? Connection, Query etc. works and now i need the real fieldname of an column.

Thanks Rico

Posted: Wed Jan 25, 2006 12:33 pm
by Manol
Please see the Resources Site:

http://www.purearea.net/pb/english/index.htm

CodeArchiv.

Databases

:D

Posted: Wed Jan 25, 2006 12:47 pm
by Rico
already, i have used the example (http://www.purearea.net/pb/CodeArchiv/D ... Example.pb), but can't find the way in this example how i can get the fieldname.
Other ideas?

Posted: Wed Jan 25, 2006 1:05 pm
by Manol
Yes, this is the function:

mysql_field_name

:)

Posted: Wed Jan 25, 2006 1:24 pm
by Manol
Hi,

Change this code:

Code: Select all

          For i=1 To rowsNum
            *mysqlRow=CallFunction(#libmysql,"mysql_fetch_row",*mysqlResult)
            *mysqlLen=CallFunction(#libmysql,"mysql_fetch_lengths",*mysqlResult)
For this one:

Code: Select all

          Dim FieldName.s(rowsNum)
          For i=1 To rowsNum
            *mysqlRow=CallFunction(#libmysql,"mysql_fetch_row",*mysqlResult)
            *mysqlLen=CallFunction(#libmysql,"mysql_fetch_lengths",*mysqlResult)
            FieldName(i)=CallFunction(#libmysql,"mysql_field_name",*mysqlResult)
            Debug FieldName(i)
Regards,
Manolo

Posted: Wed Jan 25, 2006 1:52 pm
by Rico
Compiler-Error:
Trying to write an numeric value into a string variable
in Line
FieldName(i)=CallFunction(#libmysql,"mysql_field_name",*mysqlResult)

???