Freedom-n-Democrazy Posted September 12, 2011 Share Posted September 12, 2011 What an Earth is wrong with this code? $query = "select sizes from products where id='$id'"; $result = mysql_query($query); $row = mysql_fetch_array($result); if ($row == 0) {echo "";} else {echo "Small - $row['sizes']";} PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING Quote Link to comment Share on other sites More sharing options...
Freedom-n-Democrazy Posted September 12, 2011 Author Share Posted September 12, 2011 $row should have been $row['sizes'] Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 12, 2011 Share Posted September 12, 2011 This doesn't have anything to do with the problem (Freedom already addressed that). But, this if ($row == 0) {echo "";} else {echo "Small - $row['sizes']";} Should just be if ($row != 0) {echo "Small - $row['sizes']";} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.