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
    Master Coder
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    5,419
    Thanks
    26
    Thanked 748 Times in 746 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
    29,435
    Thanks
    85
    Thanked 4,912 Times in 4,873 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.
    Be yourself. No one else is as qualified.

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