Jump to content

[SOLVED] T_VARIABLE


seeya

Recommended Posts

No, the braces are optional when there is only one line in the conditional block, the problem is that the OP isn't using the concatenation operator in the echo statement:

<?php
    if (trim($row['sCategory']) =="Bra")
	echo "Available Cup Size:" . $row['sPcup'] . "<br>";
	else
	echo "";  ?>

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/87893-solved-t_variable/#findComment-449710
Share on other sites

thanks kenrbnsn.

so sorry, i just update the code that kenrbnsn gave me and now i am thrown with this error.

 

Parse error: parse error, unexpected '<'

 

<?php
    if (trim($row['sCategory']) =="Bra")
	echo "<b><font color=#3333ff face=Verdana size=2>Available Cup Size: " .  <font face=Verdana size=2 color=brown>$row['sPcup'] . </font></font> "<br>";
	else
	echo "";  ?>code]

Link to comment
https://forums.phpfreaks.com/topic/87893-solved-t_variable/#findComment-449716
Share on other sites

You need to quote strings.

<?php
if (trim($row['sCategory']) =="Bra")
     echo "<b><font color=#3333ff face=Verdana size=2>Available Cup Size:<font face=Verdana size=2 color=brown>" . $row['sPcup'] . "</font></font> <br>";
else
     echo "";
?>

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/87893-solved-t_variable/#findComment-449724
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.