php pdo ¿What am I doing wrong? -
I am learning php pdo; My environment is: NetBeans 6.5.1, XAMPP 1.7.0 and I have this code, which it starts connecting.
- If I change the dbname to a non-existence, then it raises the exception "db
- If I change the user, then this" login wrong "raises )
But when I call a $ cn-> query, it arises:
An uncontrolled win32 exception has occurred inapache.exe
What am I doing?
$ hostname = 'localhost'; $ Username = 'crb'; $ password = 'latin'; { Try $ Cn = new PDO ("mysql: host = $ hostname; dbname = bitacora", $ username, $ password); Echo 'date
$ Sql = "SELECT * US from WHERE login = '" $ login. "' And clave = '". $ Clave. "'" "// Error associated with the base here Foreach ($ cn-> query ($ sql) as the $ line) {print $ line ['login']. '-'. $ Line ['clove'] ''
;}} Hold (PDOException $ e) {ebb $ e-> getMessage ();} hold (exception $ e) {echo $ e-> getMessage ();} < / Div>
This is a bug in XAMPP 1.7.0. Upgrade or follow up to repair your 1.7.0 installation.
Comments
Post a Comment