Raised This Month: $ Target: $400
 0% 

Getting a field using MySQL


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 10-12-2004 , 12:13  
Reply With Quote #2

Use dbi.inc instead.

When you connect, you get a resource handle to the db connection. Use it to address queries, for disconnecting etc. When you query, you get a resource handle to the query result set. Use that handle when getting data from the query result, not the handle to the db connection. Once you are done getting whatever data you need from the query result resource handle, use dbi_free_result() on it. More info in dbi.inc.

Code:
new Sql:handleConnection = dbi_connect(blablabla) new Result:handleResult = dbi_query(handleConnection, "SELECT * FROM blablablabla") for(new i = 1; dbi_nextrow(handleResult); i++) { dbi_field(handleResult, 1, storeresulthere) // gets data from 1st field }
Johnny got his gun is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode