View previous topic :: View next topic |
Author |
Message |
rpgbl
Joined: 01 Oct 2009 Posts: 30
|
Posted: Thu Oct 01, 2009 3:50 Post subject: Multiple records Retrieval in MySQL |
|
|
Hi guys,
I've got a bit of a problem. I have 5 records and each records has attributes (name, score, location etc). When I create a query SELECT * from mytablescore, the result only shows the first record. Anybody can help please? Thanks.
note : im using NWNX + MySQL by Ingmar Stieger |
|
Back to top |
|
|
Themicles
Joined: 23 Jan 2005 Posts: 30 Location: Wolverine Lake, MI
|
Posted: Fri Oct 02, 2009 5:01 Post subject: |
|
|
I do believe you have to iterate through the results with script commands. It's been years since I last wrote a script that had to do this, so details may have to wait until I have time to open up some old scripts. _________________ World Leader of Tairis'nądur http://www.tairisnadur.com
Member World of CoPaP http://www.copap.org |
|
Back to top |
|
|
Themicles
Joined: 23 Jan 2005 Posts: 30 Location: Wolverine Lake, MI
|
Posted: Fri Oct 02, 2009 5:09 Post subject: |
|
|
I decided I had time right now, so went and looked it up.
Looking at my old scripts, it looks like I'm using a while loop:
Code: | while(SQLFetch() == SQL_SUCCESS) |
I'll be honest, it's been so long since I wrote the system I'm quoting from that I don't really understand what I'm looking at anymore.
Looking at aps_include, this is the definition of the command:
Code: | // Position cursor on next row of the resultset
// Call this before using SQLGetData().
// returns: SQL_SUCCESS if there is a row
// SQL_ERROR if there are no more rows
int SQLFetch(); |
_________________ World Leader of Tairis'nądur http://www.tairisnadur.com
Member World of CoPaP http://www.copap.org |
|
Back to top |
|
|
|