Closed similarduckweed closed 4 years ago
You have not provide any necessary info, none of the required, no code snippet, no bug report.
As such look over the tests, then reopen.
`<?php
require '../common/vendor/autoload.php'; use ezsql\Database; //test $sql = "select account from user where id=1"; $db= Database::initialize('PDO', ['mysql:host=localhost;dbname=duwell;port=3306','root','root']);
$data=$db->query($sql);
Is there a problem connecting to the database?
require '../common/vendor/autoload.php';
What is that?
Look at the readme.md
examples.
You are getting the correct error, there is no error.
You are using composer autoload wrong.
If that was the case none of the tests would be passing.
erro: "
Fatal error: Uncaught ezsql\Exception\ContainerException: Can not resolve class dependency dsn in D:\phpstudy_pro\WWW\duwell\vas-cas-admin\common\vendor\ezsql\ezsql\lib\DInjector.php:144 Stack trace:
0 D:\phpstudy_pro\WWW\duwell\vas-cas-admin\common\vendor\ezsql\ezsql\lib\DInjector.php(112): ezsql\DInjector->getDependencies(Array, Array)
1 D:\phpstudy_pro\WWW\duwell\vas-cas-admin\common\vendor\ezsql\ezsql\lib\DInjector.php(50): ezsql\DInjector->resolve('PDO', Array)
2 D:\phpstudy_pro\WWW\duwell\vas-cas-admin\common\vendor\ezsql\ezsql\lib\Database.php(50): ezsql\DInjector->get('PDO', Array)
3 D:\phpstudy_pro\WWW\duwell\vas-cas-admin\login\login.php(12): ezsql\Database::initialize('PDO', Array)
4 {main}
thrown in D:\phpstudy_pro\WWW\duwell\vas-cas-admin\common\vendor\ezsql\ezsql\lib\DInjector.php on line 144
"