understanding this

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

understanding this

Post by m2babaey »

I what do these 2 lines do?

Code: Select all

$result = $db->sql_query($sql);

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

Line 1 probably executes an SQL query and sets the result of it to $result.
Line 2 sets $l_total_user_s to "TOTAL_USERS_ZERO" if $total_users is equal to 0, and to "TOTAL_USERS_OTHER" if $total_users is not equal to 0.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: understanding this

Post by califdon »

m2babaey wrote:I what do these 2 lines do?

Code: Select all

$result = $db->sql_query($sql);

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
Someone has kindly answered your question, but be advised that many readers will ignore a meaningless Subject line like "understanding this." If you make future posts in this forum, please indicate in your Subject line what the nature of your question is. Almost nobody has the time or patience to read every new post. We usually only read those posts that are in our area of interest. By putting a generic Subject on your post, you just about guarantee that the people most likely to be able to answer you will never read your post.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post by m2babaey »

Someone has kindly answered your question, but be advised that many readers will ignore a meaningless Subject line like "understanding this." If you make future posts in this forum, please indicate in your Subject line what the nature of your question is. Almost nobody has the time or patience to read every new post. We usually only read those posts that are in our area of interest. By putting a generic Subject on your post, you just about guarantee that the people most likely to be able to answer you will never read your post.
You are right. I'm sorry for that bad title. but no meaningful title came to my mind except including the code in the subject that would be too long :oops:
Post Reply