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 to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected T_DNUMBER in

    Hello all, I am getting this error which is strange for me because as far as I know the installation was successful. Can anyone help me out here in identifying the issue? The error I am getting is:

    Parse error: syntax error, unexpected T_DNUMBER in /home/content/47/10864367/html/file/dbc.php on line 2

    Here is the code:


    <?
    mysql_connect(name.db.10862977.hostedresource.com, DatabaseName, DatabasePassword) or die(mysql_error());
    mysql_select_db(DatabaseName or die(mysql_error());

    $result = mysql_query("SELECT * FROM settings") or die(mysql_error());
    while($row = mysql_fetch_array( $result ))
    {
    $settings_title = $row["site_title"];
    $settings_url = $row["url"];
    $settings_facebook_url = $row["fb_url"];
    $settings_twitter_url = $row["twitter_url"];
    $settings_google_url = $row["google_url"];
    $settings_ad1 = $row["ad1"];
    $settings_ad2 = $row["ad2"];
    $settings_ad3 = $row["ad3"];
    $settings_feeds = $row["feeds"];
    }
    ?>


    Any ideas? thank you in advance!

  • #2
    Regular Coder
    Join Date
    Jun 2009
    Posts
    134
    Thanks
    3
    Thanked 19 Times in 19 Posts
    Your syntax is wrong, we can all edit the code but you will not understand why. The error is telling you a problem is occuring at line2, so the error is line 2 or above. You need to look at the clues the error is telling you. Also any php editor would highlight this synatax as incorrect, what one are you using?? In this case it is line 1. Please look at the structure for creating a mysql connection.

    PHP Code:
    mysql_connect("localhost""admin""1admin") or die(mysql_error());
    echo 
    "Connected to MySQL<br />"
    BTW this method is depreciated, take a look at mysqli if you are just starting out.

  • #3
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by itxtme View Post
    Your syntax is wrong, we can all edit the code but you will not understand why. The error is telling you a problem is occuring at line2, so the error is line 2 or above. You need to look at the clues the error is telling you. Also any php editor would highlight this synatax as incorrect, what one are you using?? In this case it is line 1. Please look at the structure for creating a mysql connection.

    PHP Code:
    mysql_connect("localhost""admin""1admin") or die(mysql_error());
    echo 
    "Connected to MySQL<br />"
    BTW this method is depreciated, take a look at mysqli if you are just starting out.
    Thank you, but i'm very new at this and still have no idea lol


  •  

    Posting Permissions

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