unexpected T_STRING in D:\intranet\include\qaDatabaseLib.php on line 44

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

    unexpected T_STRING in D:\intranet\include\qaDatabaseLib.php on line 44

    Hello,
    Thanks in advance for your help, I have 3 pages generating the same
    exact error on the same section of each page and I can't see the
    problem - hoping a second set of eyes can help. I verified all
    closing braces etc. and can't understand why the line in question is
    generating a T_STRING error
    Here is the code:
    //-----------------------------------------------------
    //THIS IS LINE 44
    fuction dbConnect($aDbT able,$SQLstat)
    // END OF LINE 44
    {

    global $dataRow, $db, $SQLstat, $Result;

    if (!($db = odbc_connect('$ SQLstat','sa',' ')))
    {
    //Connection Error Check
    print '<span class="error"> Could not establish connection to
    $db.</span>';
    exit;
    }//end if

    // Result error check
    if (!($Result = odbc_exec($db,$ SQLstat)))
    {
    //exit if there are errors when executing SQL
    print "####<BR>";
    print "Query Used: <BR>";
    print $SQLstat;
    print ("<BR>");
    print "####<BR>";
    print ("Could not execute query: ");
    $errorMsg = odbc_errormessa ge($db);
    print ("'<span class=\"error\" > $errorMsg </span>'");
    exit;

    }//end if
    }

    $dataRow = odbc_fetch_arra y($Result);

    }
  • Pedro Graca

    #2
    Re: unexpected T_STRING in D:\intranet\inc lude\qaDatabase Lib.php on line 44

    Paul wrote:[color=blue]
    > Thanks in advance for your help, I have 3 pages generating the same
    > exact error on the same section of each page and I can't see the
    > problem - hoping a second set of eyes can help. I verified all
    > closing braces etc. and can't understand why the line in question is
    > generating a T_STRING error
    > Here is the code:
    > //-----------------------------------------------------
    > //THIS IS LINE 44
    > fuction dbConnect($aDbT able,$SQLstat)[/color]
    ___^^___

    did you mean function? or was this a copying error?


    Anyway, if the error generated somewhere else than line 44 that was
    *before* this line. Show the code from the start to line 44 instead (no
    use for us to look for errors in line 44 forwards)
    --
    USENET would be a better place if everybody read: : mail address :
    http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
    http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
    http://www.expita.com/nomime.html : to 10K bytes :

    Comment

    • Tom Thackrey

      #3
      Re: unexpected T_STRING in D:\intranet\inc lude\qaDatabase Lib.php on line 44


      On 31-Mar-2004, paul@sysxperts. com (Paul) wrote:
      [color=blue]
      > Thanks in advance for your help, I have 3 pages generating the same
      > exact error on the same section of each page and I can't see the
      > problem - hoping a second set of eyes can help. I verified all
      > closing braces etc. and can't understand why the line in question is
      > generating a T_STRING error
      > Here is the code:
      > //-----------------------------------------------------
      > //THIS IS LINE 44
      > fuction dbConnect($aDbT able,$SQLstat)
      > // END OF LINE 44
      > {
      >
      > global $dataRow, $db, $SQLstat, $Result;
      >
      > if (!($db = odbc_connect('$ SQLstat','sa',' ')))
      > {
      > //Connection Error Check
      > print '<span class="error"> Could not establish connection to
      > $db.</span>';
      > exit;
      > }//end if
      >
      > // Result error check
      > if (!($Result = odbc_exec($db,$ SQLstat)))
      > {
      > //exit if there are errors when executing SQL
      > print "####<BR>";
      > print "Query Used: <BR>";
      > print $SQLstat;
      > print ("<BR>");
      > print "####<BR>";
      > print ("Could not execute query: ");
      > $errorMsg = odbc_errormessa ge($db);
      > print ("'<span class=\"error\" > $errorMsg </span>'");
      > exit;
      >
      > }//end if
      > }
      >
      > $dataRow = odbc_fetch_arra y($Result);
      >
      > }[/color]

      You spelled function wrong.


      --
      Tom Thackrey

      tom (at) creative (dash) light (dot) com
      do NOT send email to jamesbutler@wil lglen.net (it's reserved for spammers)

      Comment

      • Paul

        #4
        Re: unexpected T_STRING in D:\intranet\inc lude\qaDatabase Lib.php on line 44

        DOH!! Thanks guys, that was staring me right in the face and i missed
        it - always good to have more eyes around - so used to having this
        error from a missing " ; or { or something that i wasn't even thinking
        to check for spelling errors.

        Comment

        Working...