Bman900 Posted July 3, 2010 Share Posted July 3, 2010 Here is my code: <table width="500" border="1"> <tr> <td>Filename</td> <td>Uploaded By</td> <td>Date Uploaded</td> </tr> <?php $query = mysql_query("SELECT * FROM files ORDER BY id DESC LIMIT 0,10"); while ($row = mysql_fetch_assoc($query)) { if(file_exists($row['file'])){ ?> <tr> <td><?php echo $row['filename']; ?></td> <td><?php echo $row['uploader']; ?></td> <td><?php echo $row['date']; ?></td> </tr> <? } else{} } ?> </table> Error: Parse error: parse error in C:\wamp\www\mysite\download.php on line 71 I don't get this since line 71 one is the end of my script and is this line : </html> I looked it over and it looks like I closed all the if and while statments. Any one see whats wrong? Quote Link to comment https://forums.phpfreaks.com/topic/206662-while-loop/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 3, 2010 Share Posted July 3, 2010 The error is likely because of the short open tag <? - http://www.phpfreaks.com/forums/index.php/topic,303067.msg1433865.html#msg1433865 Quote Link to comment https://forums.phpfreaks.com/topic/206662-while-loop/#findComment-1080862 Share on other sites More sharing options...
Bman900 Posted July 3, 2010 Author Share Posted July 3, 2010 OMG thank you, I can't believe I did not think of that even though I read an article on why its bad to use that practice. YOUR A GENIOUS! It works like a beautiful child! Quote Link to comment https://forums.phpfreaks.com/topic/206662-while-loop/#findComment-1080866 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.