How to bind SQL variables in PHP?


Question

I want to bind variables instead of just building SQL strings. Anyway to do this in Php?

Either MySQL or PostgreSQL answers would help.

Thanks

1
3
3/11/2019 8:58:24 AM

Accepted Answer

There's e.g. PDO.
An introduction to pdo and prepared statements (including bound parameters) is located at http://docs.php.net/pdo.prepared-statements

8
12/7/2009 2:01:28 PM

You should read on the MySQL Improved Extension (MySQLi) at http://php.net/manual/en/book.mysqli.php , and on prepared statements


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon