PHP
- 26 ответов
- 0 вопросов
6
Вклад в тег
SELECT l.login,l.password,l.mail,c.name FROM login as l JOIN char as c ON (l.login = c.login) WHERE l.login = 'SomeLogin'
--- тут условие, предположим login.
$pdo = new \PDO('mysql:host=localhost;dbname=db','user','password');
$request = $pdo->prepare('SELECT l.login,l.password,l.mail,c.name FROM login as l JOIN char as c ON (l.login = c.login) WHERE l.login = :login');
$request->execute([':login' => $_POST['login']);
$result = $request->fetch(\PDO::FETCH_ASSOC);