Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code error in Chapter 7 > Generic Functions #23

Open
dtliao0303 opened this issue May 31, 2021 · 0 comments
Open

Example code error in Chapter 7 > Generic Functions #23

dtliao0303 opened this issue May 31, 2021 · 0 comments

Comments

@dtliao0303
Copy link

dtliao0303 commented May 31, 2021

It's just an example code does not affect the code for the website, but just saying...

What's showing in the book:

// Delete the book with the ISBN 978-3-16-148410-0
delete($pdo, 'book', '978-3-16-148410-0', 'isbn');

Believe the isbn# and 'isbn' should change place, like following:

// Delete the book with the ISBN 978-3-16-148410-0
delete($pdo, 'book', 'isbn', '978-3-16-148410-0');

This is the function code:

function delete($pdo, $table, $primaryKey, $id ) {
    $parameters = [':id' => $id];
    query($pdo, 'DELETE FROM `' . $table . '` 
    WHERE `' . $primaryKey . '` = :id', $parameters);
}
@dtliao0303 dtliao0303 changed the title Sample code error in Chapter 7 > Generic Functions Example code error in Chapter 7 > Generic Functions May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant