unexpected t_variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • _Skare_Krow_

    #1

    unexpected t_variable

    I'm having trouble with my code and it barfs on the last line I have
    included the lines before it are below
    $histid = $_GET["histid"];
    $sql = "select * from main_hist where histid = '$histid'";
    $result = mysql_query($sq l);
    $r = mysql_fetch_arr ay($result)
    $maint_done = $r["maint_done "];
    does anyone see anything wrong with this or do I need to include more of
    the code.

    Aaron
  • Hendri Kurniawan

    #2
    Re: unexpected t_variable

    See the actual error code... It will say which line the problem lies.
    In this instance... see the line:

    $r = mysql_fetch_arr ay($result)

    You missed the terminating character (semi-colon).

    Hendri

    _Skare_Krow_ wrote:
    I'm having trouble with my code and it barfs on the last line I have
    included the lines before it are below
    $histid = $_GET["histid"];
    $sql = "select * from main_hist where histid = '$histid'";
    $result = mysql_query($sq l);
    $r = mysql_fetch_arr ay($result)
    $maint_done = $r["maint_done "];
    does anyone see anything wrong with this or do I need to include more of
    the code.
    >
    Aaron

    Comment

    • pangea33

      #3
      Re: unexpected t_variable


      _Skare_Krow_ wrote:
      I'm having trouble with my code and it barfs on the last line I have
      included the lines before it are below
      $histid = $_GET["histid"];
      $sql = "select * from main_hist where histid = '$histid'";
      $result = mysql_query($sq l);
      $r = mysql_fetch_arr ay($result)
      $maint_done = $r["maint_done "];
      does anyone see anything wrong with this or do I need to include more of
      the code.
      >
      Aaron
      As in your case, this is often caused by a missing semi-colon.

      $r = mysql_fetch_arr ay($result)

      Comment

      • _Skare_Krow_

        #4
        Re: unexpected t_variable

        That's a real big duh!


        _Skare_Krow_ wrote:
        I'm having trouble with my code and it barfs on the last line I have
        included the lines before it are below
        $histid = $_GET["histid"];
        $sql = "select * from main_hist
        where histid = '$histid'";
        $result = mysql_query($sq l);
        $r = mysql_fetch_arr ay($result)
        $maint_done = $r["maint_done "];
        does anyone see anything wrong with this or do I need to include more of
        the code.
        >
        Aaron

        Comment

        Working...