Raised This Month: $32 Target: $400
 8% 

NEW DBI API (MySQL /SQL)


Post New Thread Reply   
 
Thread Tools Display Modes
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 09-17-2005 , 19:14  
Reply With Quote #41

i don't get what this should do
i'm a complete noob at mysql
Code:
new Result:res = dbi_query(mysql, "SELECT * FROM config")
__________________
- Bye bye!
nightscreem is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-17-2005 , 20:35  
Reply With Quote #42

* means everything
So it will SELECT EVERYTHING FROM config
Freecode is offline
aragon
New Member
Join Date: Sep 2005
Old 09-28-2005 , 18:23  
Reply With Quote #43

Quote:
Originally Posted by BAILOPAN
Connections are killed at map change.

dbi_close() will automatically reset the handle you made to -1 so you don't try to use it again.
How about connection lost due to other issues? Network problems, etc?
Will the handle obtainded from dbi_connect be changed, so I can detect this situation just by:
Code:
if(connection_handle < SQL_OK ) {
  // try to reconnect or exit
}
? If not, what is the proper way to do it? And is it possible to get info about the cause of the disconnection?
aragon is offline
BAILOPAN
Join Date: Jan 2004
Old 09-29-2005 , 02:50  
Reply With Quote #44

No, the handle will not be changed. If the connection suddenly dies, you will have to close and re-open it. You can check for a dead connection by seeing if a query died when it shouldn't (RESULT_FAILED).
__________________
egg
BAILOPAN is offline
Eiver
New Member
Join Date: May 2007
Old 05-05-2007 , 05:54   Re: NEW DBI API (MySQL /SQL)
Reply With Quote #45

It seems that the DBI API cannot handle multiple result sets from stored procedures.
Executing queries like the one below will always fail:

dbi_query(dbhandle,"call MyStoredProc('Some input','Some more input')");

The query above works only if the stored procedure does not return anything. If it returns something, it will always fail.

I know that other APIs (like for example PHP and its mysql_query()) also had this problem. However in PHP it was possible to set client options, so that it would accept result sets from a stored procedure.

Is there a way to get around this problem in DBI API in AMX MOD X?

P.S
Since SQLX also has the same issue a new thread was created to deal with this problem in general.
The discussion is continued here http://forums.alliedmods.net/showthread.php?t=54852

Last edited by Eiver; 05-05-2007 at 16:53. Reason: A more general problem, that requires a separate thread
Eiver is offline
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 09-22-2007 , 19:48   Re: NEW DBI API (MySQL /SQL)
Reply With Quote #46

http://bugs.alliedmods.net/index.php...ls&task_id=281
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
Reply


Thread Tools
Display Modes

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 05:26.


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