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 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2012
    Location
    Philippines
    Posts
    11
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Question [HELP]Parse error: syntax error, unexpected T_VARIABLE

    Hello guys. I'm having trouble with the error on my codes. Please can someone help me with this problem?

    The Error:


    MySQL:


    My Code:
    PHP Code:
    <?php

    //Connect to our Database
    $connect mysql_connect("localhost","root","") or die("Could not connect to database!");
    if(!
    $connect)
        die(
    "No Database!");
    if(!
    mysql_select_db("animecore",$connect))
        die(
    "No Database Selected!")

    //Selecting Table from Database

    //Templates
    $tem1 "SELECT templates FROM config";
    $tem2 mysql_query($tem1) or die ("Could not select template!");
    $template mysql_fetch_array($tem2);

    ?>
    I am using WAMPSERVER 2.2
    Thanks in Advance!

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,466
    Thanks
    23
    Thanked 634 Times in 633 Posts
    Code:
    if(!mysql_select_db("animecore", $connect))
    		die("No Database Selected!");
    Add the ; to the above.

    Five more char. added to satisfy the editor, disregard this.

  • Users who have thanked sunfighter for this post:

    KazeFlame (11-29-2012)

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,589
    Thanks
    80
    Thanked 4,498 Times in 4,462 Posts
    By the by, this has nothing to do with MySQL.

    Any time you see a message that includes T_VARIABLE or other T_xxx elements it is strictly a PHP error.

    If it were a MySQL error, it would say so.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    KazeFlame (11-29-2012)


  •  

    Posting Permissions

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