[Mysql Api] Problem with tables listing



Hello,


I posted this message in alt.comp.databases.mysql but I fear that very few peoples are visiting this newsgroup at this time...
So I rewrite my message here:


I'm a newbie with the C API (I program under Debian Sarge with Gcc-3.3.5)

I have a database which called "loges" and I would like to list the tables in the shell's output (with printf).

Like that:

table1
table2
table3


But on the output I just get that:

tables_in_loges

I don't know where is my error...

Here is my source:


/*******************************/



MYSQL mysql_handle;
MYSQL_FIELD *tables;
MYSQL_RES *result;

unsigned int nb_tables;
mysql_init(&mysql_handle);

// login_datas is a structure with my username, password etc... if(!mysql_real_connect(&mysql_handle,login_datas.host,login_datas.
user,login_datas.password,login_datas.database,3386,NULL,0))
{
printf("Erreur1\n");
}


result=mysql_list_tables(&mysql_handle,NULL);
if (result==NULL){
    printf("Error2\n");
}

if (result)
{
    nb_tables=mysql_num_fields(result);
}
tables=mysql_fetch_fields(result);
for (i=0;i<nb_tables;i++)
{
    printf("%s\n",tables[i]);
}

/****************************************/

Thanks....
.



Relevant Pages

  • RE: Restore public folders and companyweb
    ... Thank you for posting in the SBS newsgroup. ... I understand that the Public Folder Store ... database cannot be mounted due to integrity problems, ...
    (microsoft.public.windows.server.sbs)
  • RE: Companyweb caanot load
    ... Welcome to SBS newsgroup. ... Check the database connection ... As you could not access the companyweb any more, ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • RE: Scecli and jet database event 1005 and 1202 repeating
    ... This issue occurs if the local Group Policy database file is corrupt. ... Microsoft CSS Online Newsgroup Support ... Open the %SystemRoot%\Security folder, create a new folder, and then ...
    (microsoft.public.windows.server.sbs)
  • RE: Move the monitoring database
    ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... | Thread-Topic: Move the monitoring database ... | for Windows Small Business Server 2003" document only specifies moving ...
    (microsoft.public.windows.server.sbs)
  • RE: microsoft.public.exchange.admin,microsoft.public.windows.server.sbs
    ... Thank you for posting in the SBS newsgroup. ... you need to run 'Eseutil /cc' for hard recovery in current condition. ... Did you select the "Last Restore Set" check box in backup when you restore ... When a database is restored from backup media, it is in what is referred to ...
    (microsoft.public.windows.server.sbs)