can't get my head round simple if statement..

Codes here !

Moderators: macek, egami, gesf

iamandywarren
New php-forum User
New php-forum User
Posts: 2
Joined: Fri May 02, 2014 4:53 am

can't get my head round simple if statement..

Postby iamandywarren » Thu May 29, 2014 3:06 am

Hi all..

I can write this in english but can't think how to put this or even search for the if statement I'm looking for..

so I have a table such as this..
id - lineno - hitcount
1 - 2 - 0
2 - 2 - 0
3 - 3 - 0
4 - 3 - 1
5 - 4 - 0
6 - 4 - 0
7 - 4 - 0

And want to echo only if the hitcount is 0 for everything with a lineno of x

So in this case I should return lines 1,2,5,6 & 7 but not 3.

Any help appreciated

Andy.

developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: can't get my head round simple if statement..

Postby developerahusain » Sat May 31, 2014 10:50 pm

if ($hitcount=="0") echo "How are you";else echo "HI";

Do it like this. Any problem,do revert.

Developerahusain


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 3 guests

cron