How to
#1

Hi guys!

How to check if my business variable has a name( BizName) ?

I am checking wether bizname has something more than just a blank varchar (yes, I am using mysql) or else if it's empty blahblah...

Here I "grab" it from the database

pawn Код:
cache_get_field_content(i,"BizName",BizInfo[i][BizName],MySQLHandle,40);
And now when I am creating 3D text labels, I am checking if the name is something or it's default blank

pawn Код:
if(BizInfo[idbiz][BizName])
{

}
else
{

}
This isn't working, how can I make it work? Do I have to use strcmp?
Reply
#2

Example code about sql part.
pawn Код:
mysql_format(mysql, query, sizeof(query), "SELECT `user` FROM `yourtable` WHERE `user` = '%e'", account); //you gotta change the table and column
new Cache:result = mysql_query(mysql, query);
if(cache_get_row_count() != 0)
{
    //If the rows found
}
else
{
        //if no rows exists
}
cache_delete(result);
Reply
#3

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
Example code about sql part.
pawn Код:
mysql_format(mysql, query, sizeof(query), "SELECT `user` FROM `yourtable` WHERE `user` = '%e'", account); //you gotta change the table and column
new Cache:result = mysql_query(mysql, query);
if(cache_get_row_count() != 0)
{
    //If the rows found
}
else
{
        //if no rows exists
}
cache_delete(result);
You misunderstood me. My biz loading is ok, only checking if the variable bizname has something more than just a blank space isnt working
Reply
#4

Small bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)