Right i've been able to connect to the database, not a problem.
I've been able to run Sql queries on the database again not a problem.
But when i try to retrieve data from the database using GetDatabaseString() in the following sytax's
GetDatabaseString(usrname)
GetDatabaseString("usrname")
GetDatabaseString(1)
All of the above return absolutely nothing at all even though there is only one row available for negeoation and the "usrname" field is infact filled with data and is of varchar format.
Any help?
Mysql Database problems
Rows in a database start at 0, so if your query only returns data from a single row, you must use GetDatabaseString(0).
If you had a table called "Clients" and this table contained 2 columns called "First" and "Last", and your query looked like this...
This will retrieve the data "First" and "Last" (in that order) from the table "Clients" sorted by "Last" in ascending order.
So column position 0 will contain the data in column "First" and column position 1 will contain the data in column "Last".
The While/Wend loop continues until all data has been retrieved.
Make sense?
If you had a table called "Clients" and this table contained 2 columns called "First" and "Last", and your query looked like this...
Code: Select all
If DatabaseQuery("Select Clients.First,Clients.Last from Clients Order by Clients.Last ASC;")
While NextDatabaseRow()
debug GetDatabaseString(0)
debug GetDatabaseString(1)
Wend
EndIf
So column position 0 will contain the data in column "First" and column position 1 will contain the data in column "Last".
The While/Wend loop continues until all data has been retrieved.
Make sense?



