Jump to content

UseSQL : mysql database class


keevitaja

Recommended Posts

Great work on the website and the class with a few remarks on the latter:

 

1) UseSQL would possibly be more useful if you allowed it to connect to more RDBMS then only MySQL (eg. extend PDO and make it a Database Abstraction Layer)

2) Don't mix HTML into your class

3) Use Exception's instead of letting your class handle any and all error's

4) Nearly no data is being filtered before being written to the database exposing anyone who uses your class to SQL injection

5) You assume an "id" convention, bare in mind that not everyone uses pseudo-keys

 

Nevertheless I applaud your effort, keep up the good work!

about injection. to avoid it, prepared statement must be used. i can't force escaping every value in insert_row() method.

 

So if users always need to use prepared statements then why is it possible to execute a query that doesn't use them? You should only use prepared statements when you are to execute the same query multiple times with different variables. Using prepared statements merely to avoid SQL injection is over-kill as you could escape it easily yourself in the provided interface.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.