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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.