GraphiX Posted October 12, 2008 Share Posted October 12, 2008 Hello all Well, I am getting an error called "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING" Please forgive me if this is something obvious but I can't see anything wrong with me code... if(!$action || !in_array($action,$actions_array)){ $sql1 = "SELECT * FROM `forum_cats` WHERE `admin` < ".$row['admin']"+1"; $res1 = mysql_query($sql1) or die(mysql_error()); Error line is the $sql1 variable. Any thoughts? GraphiX Link to comment https://forums.phpfreaks.com/topic/128083-solved-t_constant_encapsed_string-help-please/ Share on other sites More sharing options...
JasonLewis Posted October 12, 2008 Share Posted October 12, 2008 You're missing the period (.) when going back into the string: Yours: $sql1 = "SELECT * FROM `forum_cats` WHERE `admin` < ".$row['admin']"+1"; Correct: $sql1 = "SELECT * FROM `forum_cats` WHERE `admin` < " . $row['admin'] . "+1"; Link to comment https://forums.phpfreaks.com/topic/128083-solved-t_constant_encapsed_string-help-please/#findComment-663289 Share on other sites More sharing options...
GraphiX Posted October 12, 2008 Author Share Posted October 12, 2008 Thanks man Link to comment https://forums.phpfreaks.com/topic/128083-solved-t_constant_encapsed_string-help-please/#findComment-663291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.