Answer the question
In order to leave comments, you need to log in
Problem with PDO?
Good afternoon
Problem with PDO PHP I can't figure out what's wrong
The id_car_mark field is of type INT
The name varchar field
If you make a direct request without an alias, then everything is fine. Boolean error false
Everything comes to the argument correctly
// Получаем данные по модели
public static function carSlug($carSlug) {
$db = Db::getConnection();
$sql = "SELECT id_car_mark from car_model where name = :myCar";
$result = $db->prepare($sql);
$result->bindParam(':myCar', $carSlug, PDO::PARAM_STR);
$result->setFetchMode(PDO::FETCH_ASSOC);
$result->execute();
return $result->fetch();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question