Marshmellow Posted July 15, 2008 Share Posted July 15, 2008 "Parse error: syntax error, unexpected T_IF --> line 35" is the error I get when running this code: 29 <?PHP 30 ini_set ('display_errors', 1); 31 error_reporting(E_ALL & E_NOTICE); 32 require_once('connect.php'); 33 print "<table border=\"0\">" 34 if($r = mysql_query('SELECT * FROM rentals ORDER BY date_entered DESC')) { 35 while($row = mysql_fetch_array($r)) { 36 print "<tr><td><a href=\"view_rental.php?id={$row['id']}\">{$row['name']}</a></td><td>{$row['description']}</td></tr>"; 37 } 38 } 39 else { 40 die('<p>Retrieval error: ' . mysql_error() . '</p>'); 41 } 42 print "</table>" 43 mysql_close(); 44 ?> The only previous php code is: 26 <?PHP include_once("navigation.php"); ?> Does anyone know what I did wrong? Any help is greatly appreciated. I can list the code of the linked files if necessary. Link to comment https://forums.phpfreaks.com/topic/114823-solved-parse-error-syntax-error-unexpected-t_if-gt-line-35/ Share on other sites More sharing options...
trq Posted July 15, 2008 Share Posted July 15, 2008 Your missing a ; on line 33. Link to comment https://forums.phpfreaks.com/topic/114823-solved-parse-error-syntax-error-unexpected-t_if-gt-line-35/#findComment-590396 Share on other sites More sharing options...
trq Posted July 15, 2008 Share Posted July 15, 2008 And line 42 while were at it. Link to comment https://forums.phpfreaks.com/topic/114823-solved-parse-error-syntax-error-unexpected-t_if-gt-line-35/#findComment-590398 Share on other sites More sharing options...
Marshmellow Posted July 15, 2008 Author Share Posted July 15, 2008 Hehe. I just can't believe I was being that dumb. I checked for semicolons quite a few times. Well, thank you, anyways. Link to comment https://forums.phpfreaks.com/topic/114823-solved-parse-error-syntax-error-unexpected-t_if-gt-line-35/#findComment-590444 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.