haXe Forum > Mysql

  • Hello, i have a news problems, i have to message error =>

    ./Db.hx:3: characters 26-27 : Unexpected =

    And my Db.hx =>

    class Db {
    
    var connection:Connection = php.db.Mysql.connect( 
    params : { 
    user : "root", 
    socket : "null", 
    port : 3306, 
    pass : "mypassword", 
    host : "localhost", 
    database : "hox" 
    } );
    
    
    var rs:ResultSet = connection.request( sql : "mysql" );
    
    connection.close();
    }

    Where is error? oO please

  • hmmm i think the error is when you pass a parameter to a function.

    this
    var connection:Connection = php.db.Mysql.connect(
    params : {
    user : "root",
    socket : "null",
    port : 3306,
    pass : "mypassword",
    host : "localhost",
    database : "hox"
    } );

    must be
    var connection:Connection = php.db.Mysql.connect(
    {
    user : "root",
    socket : "null",
    port : 3306,
    pass : "mypassword",
    host : "localhost",
    database : "hox"
    } );

    it just a syntax error ;)

  • Thanks thanks =)

< Prev | Page 1 / 1 | Next >