Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    71
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Not seeing the end of the problem

    Hello there,

    I can't seem to find the problem in my small script. Here is the code:
    PHP Code:
    <?php
    session_start
    ();
    require_once 
    'database.php';
    $userid $_SESSION['user'];
    $stats=mysql_query("SELECT * FROM user WHERE username='$userid'") or die("Error 1");
    $data=mysql_fetch_assoc($stats);
    $pm=mysql_query("SELECT * FROM mail WHERE receiverid='$data[id]' and send='0'") or die("Error 2");
    echo 
    '<table border="1" width="600px">';
    echo 
    '<tr><td>Status</td><td>From</td><td>Subject</td><td>Sent</td></tr>';
    while(
    $rows=mysql_fetch_array($pm)){
    echo 
    '<tr><td>';
    if(
    $rows[hasread] == 1){ 
    echo 
    '<img src="../images/new.gif" alt="New" width="45" height="45">';
    }
    else{ 
    echo
    '<img src="../images/old.gif" alt="Read" width="45" height="45">
    }'
    ;
    echo 
    '</td><td>'.$rows[senderid].'</td><td><a href="?page=read&id='.$rows[id].'">'.$rows[subject].'</a></td><td>'.$rows[showtime].'</td></tr>';
    // line 19
    The error is: unexpected $end on line 19
    Line 19 is marked for you. I do not see where this error is coming from. Any assistance is grateful.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by blackrain87 View Post
    Hello there,

    I can't seem to find the problem in my small script. Here is the code:
    PHP Code:
    <?php
    session_start
    ();
    require_once 
    'database.php';
    $userid $_SESSION['user'];
    $stats=mysql_query("SELECT * FROM user WHERE username='$userid'") or die("Error 1");
    $data=mysql_fetch_assoc($stats);
    $pm=mysql_query("SELECT * FROM mail WHERE receiverid='$data[id]' and send='0'") or die("Error 2");
    echo 
    '<table border="1" width="600px">';
    echo 
    '<tr><td>Status</td><td>From</td><td>Subject</td><td>Sent</td></tr>';
    while(
    $rows=mysql_fetch_array($pm)){
    echo 
    '<tr><td>';
    if(
    $rows[hasread] == 1){ 
    echo 
    '<img src="../images/new.gif" alt="New" width="45" height="45">';
    }
    else{ 
    echo
    '<img src="../images/old.gif" alt="Read" width="45" height="45">
    }'
    // <-- HERE
    echo '</td><td>'.$rows[senderid].'</td><td><a href="?page=read&id='.$rows[id].'">'.$rows[subject].'</a></td><td>'.$rows[showtime].'</td></tr>';
    // line 19
    The error is: unexpected $end on line 19
    Line 19 is marked for you. I do not see where this error is coming from. Any assistance is grateful.
    you have a single quote between } and ; on line 17.

    best regards

  • Users who have thanked oesxyl for this post:

    blackrain87 (12-25-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •