Jump to content

Stop $end


jj20051

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.