It looks to me like you're trying to use some sort of API or something, and it looks awfully similar to PHP way of doing things.
Aren't there any delphi components to connect to MySQL from Delphi? I thought there were. Try OpenSource components at
http://www.zeoslib.net.
Having installed the components all you will have to (to mimic your code) do would be something like:
PHP Code:
mySQL.Close;
mySQL.SQL.UnPrepare;
mySQL.SQL.Prepare;
mySQL.SQL.Query.Text:='SELECT * FROM staff WHERE staffid =' + enteredusername.Text+ 'AND password=' + enteredpassword.Text;
mySQL.SQL.Open;
Traversing a dataset is done like this:
PHP Code:
SomeDataSet.First; // make sure you're at the begining
while not SomeDataSet.EOF do
begin
// some code here such as:
// Caption:=SomeDataSet.Fields[0].Value;
//or
// Caption:=SomeDataSetFieldName.Value;
SomeDataSet.Next;
end;
If you have an option to use any database you pick, then try Firebird, which is closer to SQL compliance than MySQL, and unlike MySQL, it is trully free, even for commercial apps.
<edit: typos in code>