user2921077
user2921077

Reputation: 15

PHP "if" not working

I have a Table where i want to Display time someone has worked. This comes from a mySql a Field should Display the minutes, and if a other field ist true, then it should be add "high" after the minutes

I tried this:

Print "<td width=50px>";
PRINT $info['minutes'] if($info['high'] == 0 ) {echo "Hoch"} ;

and got this:

Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\callinfo.php on line 63

Someone can Help? :)

Upvotes: 0

Views: 65

Answers (3)

user3025149
user3025149

Reputation:

It lacks a ; after PRINT $info['minutes']

PRINT $info['minutes'];

Upvotes: 1

Duniyadnd
Duniyadnd

Reputation: 4043

You need to space out your code if you can't handle parse errors. Also, print/echo are pretty much same, use one or the other, not both, make your life easier in the future when you're looking for specific code.

PRINT $info['minutes'];
if ( $info['high'] == 0 ) {
    echo "Hoch";
}

Upvotes: 2

Patato
Patato

Reputation: 1472

you need to add ;

PRINT $info['minutes'] ;
if($info['high'] == 0 )
{
   echo "Hoch";
}

Upvotes: 1

Related Questions