0
$name = $_POST['name'];
$statement = $db->prepare("SELECT * FROM authors WHERE name = ?");
$statement->execute(array($name));
$author_id = $statement->fetch()["id"];
$statement = $db->prepare("SELECT * FROM quotes WHERE author_id = ?");
$statement->execute(array($author_id));
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$quote = $row['quote'];
}
如何在laravel查詢生成器中執行相同的操作?Laravel Query Builder取多表
其工作,,感謝ü這麼多。 –