I use this code snippet to retrieve the table names from the database:
Code: Select all
UseMySQLDatabase()
host.s = "host=127.0.0.1 port=3306 dbname=mysql test" -> results in table name list for database mysql
;host.s = Chr(34)+"host=127.0.0.1 port=3306 dbname=mysql test"+Chr(34) -> results in table name list for database mysql
;host.s = "host=127.0.0.1 port=3306 dbname=`mysql test`" -> results in error message: Unknown database '`mysql'
;host.s = "host=127.0.0.1 port=3306 dbname='mysql test'" -> results in error message: Unknown database ''mysql'
;host.s = "host=127.0.0.1 port=3306 dbname=" + Chr(34) + "mysql test" + Chr(34) -> results in error message: Unknown database '"mysql'
If OpenDatabase(0, host, "user", "password")
If Not DatabaseQuery(0,"SHOW TABLES")
Debug "DatabaseQuery: "+DatabaseError()
Else
While NextDatabaseRow(0)
Debug GetDatabaseString(0,0)
Wend
FinishDatabaseQuery(0)
CloseDatabase(0)
EndIf
Else
Debug "OpenDatabase:"+DatabaseError()
EndIf
Is there a way to mask the space?