fullyloaded Posted July 23, 2012 Share Posted July 23, 2012 Hii'm getting this error, Parse error: syntax error, unexpected T_LOGICAL_AND in on this line And user = '{$user}'"; but dont think the error is there, anyone have any idea how to fix this error thanks.code: <?php$checkbox = $_POST['checkbox'];$delete = mysql_real_escape_string(strip_tags($_POST['delete']));$user = mysql_real_escape_string($_SESSION['id']);$img = mysql_real_escape_string(strip_tags($_POST['img']));if($delete){ for($i=0;$i>$count;$i++) { $del_id = $checkbox[$i]; // Get the image path. $img_q = mysql_query("SELECT `img` FROM messages WHERE id = '{$del_id}' And user = '{$user}'") or die(mysql_error()); if(mysql_num_rows($img_q) > 0) { $img = mysql_result($img_q, 0); } unlink($img); And user = '{$user}'"; $sql = "DELETE FROM messages WHERE id = '{$del_id}' And user = '{$user}'"; mysql_query($sql, $conn) or die('Error in query:<br>'. $sql .'<br>'.mysql_error($conn).'<br>Time of Error: '.date("l F j, Y, G:i:s T")); } if($result){ echo "<meta http-equiv=\"refresh\" content=\"0\">\n"; }} mysql_close(); Link to comment Share on other sites More sharing options...
birbal Posted July 23, 2012 Share Posted July 23, 2012 (edited) here And user = '{$user}'"; you cant have it like that. the error says it all it thinks it as logical 'and' which is in appropiate syntactically at that place Edited July 23, 2012 by birbal Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now