Proofread my MySQL Handler?

Discussion in 'Plugin Development' started by xDrapor, Aug 25, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    xDrapor

    So, based off the SQL lib, I made my own SQL handler to perform functions. I had one perfectly working about a month ago, however, I lost all my work on DynamicBan 2 because of a laptop failure. Rest assured I have gotten a boss computer, and have begun redevelopment from scratch (*sigh*). However, I'm kinda rusty with my SQL skills, would anyone be kind enough to proof read my work for me, and point me towards any possible errors (Yeah, I know I could test it and check console, but at the moment I barely have time to setup a new server, will do so in the near future).

    http://pastebin.com/Dj6zcAtc

    Thanks,

    xDrapor
     
  2. Offline

    Giant

    Don't use single quotes (') around table nor column names. That will make your SQL database see them as a string, which you don't want. Do add single quotes around values though, unless you know that value is an integer or such, as in that case you can send it as more or less raw.

    Some people might suggest back ticks (`) around table and column names, I however would not use these either, as the only thing they do is allow you to use reserved keywords as names, and a few more additional characters, such as a + and -. However, using these can and most likely WILL break your head when you move from MySQL to say SQLite...
     
  3. Offline

    xDrapor

    Thank you! I had used back ticks in my old Handler now that you mention it, I'll make these changes now.
     
Thread Status:
Not open for further replies.

Share This Page