Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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