i need help for error in installation::syntax error(T-VARIABLE)

Discussion in 'PHP' started by MK TheLion, Jun 24, 2016.

  1. #1
    i get this error


    Parse error: syntax error, unexpected '$dbpassword' (T_VARIABLE) in /home/kichainc/public_html/user/admin/z_db.php on line 9


    and script is


    <?
    error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);
    
    $dbservertype='mysql';
    
    $servername='localhost';
    
    $dbusername='root'; kichc_1
    $dbpassword='';yhasp456
    
    $dbname='kicinc_100khain';
    
    
    
    
    ////////////////////////////////////////
    ////// DONOT EDIT BELOW  /////////
    ///////////////////////////////////////
    
    connecttodb($servername,$dbname,$dbusername,$dbpassword);
    function connecttodb($servername,$dbname,$dbuser,$dbpassword)
    {
    global $link;
    $link=mysql_connect ("$servername","$dbuser","$dbpassword");
    if(!$link){die("Could not connect to MySQL");}
    mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());
    }
    ?>
    Code (markup):


    can you tell me how to solve this issue

     
    Solved! View solution.
    Last edited by a moderator: Jun 24, 2016
    MK TheLion, Jun 24, 2016 IP
  2. #2
    Eh... Did you LOOK at that code?

    Fix the quote errors:

    $dbusername='root'; kichc_1
    $dbpassword='';yhasp456


    And what is that kichc_1 doing not assigned to anything. The password is outside the quotes.

    *shakes head*
     
    PoPSiCLe, Jun 24, 2016 IP
    sarahk likes this.