Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/04/2021 in all areas

  1. Pardon the unsolicited advice, but unless your DB class does something really special it looks like you're making things far more difficult than they need to be. PDO is already an abstraction class; just use it. Your query() method and call can be done as such: $qry = " SELECT username FROM users WHERE username = ? "; $sql = $pdo->prepare($qry); $sql->execute(['TechnoDiver']); die("<pre>".var_export($sql->fetchAll(), true)."</pre>"); And obviously your query is meant for SELECT statements, but keep in mind if you're planning on extending to INSERT or UPDATE the performance benefits of prepare(). From the documentation: So, at that point you're forced to recreate the prepare() method in order to bind multiple arrays of values to the same query.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.