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

MYSQL - How To Select a row and print it out


Post New Thread Reply   
 
Thread Tools Display Modes
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 05-26-2019 , 12:08   Re: MYSQL - How To Select a row and print it out
Reply With Quote #11

Quote:
Originally Posted by iskenderkebab33 View Post
and how to do a if() example:

if(sirname = "Tom")
{
PrintToChat(Client, "You sirname is Tom");
}
else
{
PrintToChat(Client, "You sirname is NOT Tom");
}
PHP Code:
if (StrEqual(sName"Tom")
{
    
PrintToChat(Client"You sirname is Tom");
} else {
    
PrintToChat(Client"Your sirname is NOT Tom");

ThatKidWhoGames is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 05-28-2019 , 07:32   Re: MYSQL - How To Select a row and print it out
Reply With Quote #12

You shouldn't compare strings like that. Use strcmp (strncmp if you want to compare string from beginning) OR StrEqual (uses strcmp but more readable because returns true or false instead of integers like strcmp does).

EDIT: Didn't notice the post above.

EDIT 2: In this example you can also use this:
Code:
PrintToChat(Client, StrEqual(sName, "Tom") ? "Your sirname is Tom" : "Your sirname is NOT Tom");
__________________

Last edited by MAGNAT2645; 05-28-2019 at 07:34.
MAGNAT2645 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 06:19.


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