jj20051 Posted August 9, 2010 Share Posted August 9, 2010 I have a system setup to pull a while() query out of a file. As follows: // In another file that is included into the one I'm running. $support_1_start = './includes/modules/while/support.1.open.php'; $support_1_stop = './includes/modules/while/support.1.close.php'; // The actual file. include($support_1_start); // This starts the mysql while() query. ?> // Data should be displayed here... <?php include($support_2_stop); // This ends the mysql while() query. The only problem is that I'm getting the following error: Parse error: syntax error, unexpected $end in /home/nuke/public_html/includes/modules/while/support.1.open.php on line 16 I assume its because I included the while() function, but didn't close it in that file, but instead another file. Maybe you know how to fix this? If you want my complete source code in order of what is ran: http://www.nuclear.apnx.us/source.txt Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/ Share on other sites More sharing options...
onlyican Posted August 9, 2010 Share Posted August 9, 2010 Sounds to me your missing a } Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/#findComment-1097010 Share on other sites More sharing options...
onlyican Posted August 9, 2010 Share Posted August 9, 2010 I have had a look at your code, the error appears to be from one of your includes. Try commenting out all includes and test if it works Then uncomment one by one, u will find the include file causing the issue Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/#findComment-1097014 Share on other sites More sharing options...
wildteen88 Posted August 9, 2010 Share Posted August 9, 2010 You cannot open/close PHP code blocks (the { and }) within separate PHP files. Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/#findComment-1097080 Share on other sites More sharing options...
jj20051 Posted August 9, 2010 Author Share Posted August 9, 2010 So do you have any suggestions for making it work? Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/#findComment-1097097 Share on other sites More sharing options...
wildteen88 Posted August 9, 2010 Share Posted August 9, 2010 Not to use includes in that way <?php if($number_support == 0) { ?> <tr><td colspan="3" width="100%"><div align="center"><a href="tickets.php">No active tickets, click here to open a ticket</a></div></td></tr></table> <?php } else { $query = "SELECT ticket_id, ticket_title, ticket_reply, urgency, answered FROM support_tickets WHERE user_id='$user_id' && initial='1' && status='open' ORDER BY ticket_id DESC"; $user_tickets = mysql_query($query) or die('[Error 016 - Support Module 1 Failed]'); while(list($ticket_id, $ticket_title, $ticket_reply, $urgency, $answered) = mysql_fetch_row($user_tickets)) { $answered = ($answered == 0) ? 'Unanswered' : 'Answered'; ?> <tr><td><a href="tickets.php?id=<?php echo $ticket_id; ?>"><?php echo $ticket_title; ?></a></td><td><div align="center"><?php echo $ticket_reply; ?></div></td><td><div align="center"><?php echo $ticket_urgency; ?></div></td></tr> <?php } } ?> Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/#findComment-1097108 Share on other sites More sharing options...
jj20051 Posted August 9, 2010 Author Share Posted August 9, 2010 Not exactly what I had in mind... Whatever. Link to comment https://forums.phpfreaks.com/topic/210217-stop-end/#findComment-1097114 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.