i am looking for a simple secure php/mysql class to use in simple 3 pages script.
Asked
Active
Viewed 1,575 times
1
-
possible duplicate of [A secure PHP class connecting to MySQL?](http://stackoverflow.com/questions/5196162/a-secure-php-class-connecting-to-mysql) – Jim Apr 21 '11 at 16:13
-
4have you looked at [PDO](http://stackoverflow.com/q/1742066/112968)? also please define 'secure', your exact needs, etc. – knittl Apr 21 '11 at 16:13
-
As far as "secure". The all classes / function generally have methods to securing them. But it is up to you to understand how to use them and use them properly. Any class, no matter how secure it is, can be used and if the proper methods are not used, all the security is worthless. Better advice, pick a method and fully read about it and read how to properly secure it. – Jim Apr 21 '11 at 18:43
3 Answers
2
I would recommend PDO. Some of it's advanced functions can be handy from time to time.

Nitram Saneco
- 191
- 4
0
If it is really small and simple just use the built in mysql function.
You can read all about it right here http://php.net/manual/en/book.mysql.php

austinbv
- 9,297
- 6
- 50
- 82
-
1
-
If by "really small and simple" you mean "under 100 lines of code". Beyond that, the old `mysql-*` function group becomes cumbersome rather quickly; I'd recommend using `mysqli` (things have a tendency to grow - an old, really small and simple project of mine is now a rather important part of one not-small-and-not-simple app - and I wish I would not have coded that initial small thingy as a throwaway-simple-project it was intended to be). – Piskvor left the building Apr 21 '11 at 16:28