Plzzzzzz help me with this error

Discussion in 'PHP' started by darkknight007, Mar 8, 2010.

  1. #1
    my configuration



    <?
    ob_start();session_start();
    $hostname = "localhost";
    $data_username = "rapidxpr_admin";
    $data_password = "********";
    $data_basename = "rapidxpr_surveyz4u";
    $conn = mysql_connect("".$localhost."","".$rapidxpr_admin."","".$**********."");
    mysql_select_db("".$rapidxpr_surveyz4u."") or die(mysql_error());
    $bonuspoints=10;
    $mainpointsneeded=200;
    ?>


    But when i try to access my website i get an error saying:

    Parse error: syntax error, unexpected T_DNUMBER, expecting T_VARIABLE or '$' in /home/rapidxpr/surveyz4u.co.cc/config.php on line 7

    Can anyone help me with the correct configuration

    I'll appreciate ur help
     
    darkknight007, Mar 8, 2010 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    tried it.. check your variable names on mysql_connect line 7
     
    bartolay13, Mar 8, 2010 IP
  3. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #3
    Replace this line :
    $conn = mysql_connect("".$localhost."","".$rapidxpr_admin."","".$**********."");

    with

    $conn = mysql_connect($hostname,$data_username,$data_password);

    and you should be ok.
     
    samyak, Mar 8, 2010 IP
  4. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #4
    oh! also,

    Replace this line: mysql_select_db("".$rapidxpr_surveyz4u."") or die(mysql_error());
    with
    mysql_select_db($data_basename) or die(mysql_error());
     
    samyak, Mar 8, 2010 IP
  5. darkknight007

    darkknight007 Member

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #5
    thanx 4 u r help samyak and bartolay13 but iam still getting the error

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/rapidxpr/surveyz4u.co.cc/config.php on line 7


    my current configuration

    <?
    ob_start();session_start();
    $hostname = "localhost"; //your hostname (normally localhost)
    $data_username = "rapidxpr_admin"; //database username
    $data_password = "******"; //database password
    $data_basename = "rapidxpr_surveyz4u"; //database name
    $conn = mysql_connect($localhost,$rapidxpr_admin,$***************);
    mysql_select_db($rapidxpr_surveyz4u) or die(mysql_error());
    $bonuspoints=10; //bonus points awarded for new users
    $mainpointsneeded=200; //max number of points needed before user can request voucher
    ?>
     
    Last edited: Mar 9, 2010
    darkknight007, Mar 9, 2010 IP
  6. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #6
    Just enter your database password and you should be good to go.

    
    <?
    ob_start();session_start();
    $hostname = "localhost";
    $data_username = "rapidxpr_admin";
    $data_password = "******"; 
    $data_basename = "rapidxpr_surveyz4u";
    $conn = mysql_connect("".$hostname."","".$data_username."","".$data_password.""); 
    mysql_select_db("".$data_basename."") or die(mysql_error()); 
    $bonuspoints=10;
    $mainpointsneeded=200;
    ?>
    
    Code (markup):
     
    MyVodaFone, Mar 9, 2010 IP
  7. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #7
    Are you sure you are looking at the correct PHP file? IS the code that you posted on the config.php file?
     
    samyak, Mar 9, 2010 IP
  8. darkknight007

    darkknight007 Member

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #8
    thanx mr myvodafone it worked,thanx to all of u who helped me out
     
    darkknight007, Mar 9, 2010 IP