Raised This Month: $12 Target: $400
 3% 

SQL result


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 11-29-2019 , 08:50   SQL result
Reply With Quote #1

how it effects? if i change read result column number?

PHP Code:
new SQL_ReadResult(query1)
new 
=SQL_ReadResult(query2)
new 
SQL_ReadResult(query3
PHP Code:
new SQL_ReadResult(query1)
new 
=SQL_ReadResult(query3)
new 
SQL_ReadResult(query2
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 11-29-2019 , 09:13   Re: SQL result
Reply With Quote #2

doesn't matter which name you choose for variables , the "=" symbol saves the query result into the variable so you can use the variable instead of calling the native multiple times.

Last edited by LearninG; 11-29-2019 at 09:15.
LearninG is offline
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 11-29-2019 , 09:28   Re: SQL result
Reply With Quote #3

Quote:
Originally Posted by LearninG View Post
doesn't matter which name you choose for variables , the "=" symbol saves the query result into the variable so you can use the variable instead of calling the native multiple times.
so it wont effect any sql results right and also can you tell me what that number actual does?
__________________

Last edited by Sanjay Singh; 11-29-2019 at 09:28.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 11-29-2019 , 09:39   Re: SQL result
Reply With Quote #4

Quote:
Originally Posted by Sanjay Singh View Post
so it wont effect any sql results right and also can you tell me what that number actual does?
no , it just reads the result , about number i'm not sure.
LearninG is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-29-2019 , 09:52   Re: SQL result
Reply With Quote #5

The number specifies which column you are retrieving. The order in which you access the data does not matter or impact subsequent reads.
__________________
Bugsy is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-29-2019 , 11:43   Re: SQL result
Reply With Quote #6

Code:
new Result = SQL_Result(Query, SQL_FieldNameToNum("column_name"));
I think that you can convert column names into numbers that you need
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 11-29-2019 at 11:44.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-29-2019 , 13:09   Re: SQL result
Reply With Quote #7

You can save some native calls by just entering the column numbers in the same order as the fields in your SELECT query.
__________________
Bugsy is offline
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 08:46.


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