0

i am using mysql like from ages .. Is it safe to use it anymore ?? deprecated is the word i m getting everywhere .. I got through a lot of questions in stackoverflow but still ve some doubts.. So my doubts are:

If i ll change my db connection string using mysqli , do i need to change it in every select update n insert query ..

I m using xampp control panel version 3.2.1.. Do i need to update it or need to change in php.ini ..(Not so handy in mysqli)

What more changes i need to put and what about pdo .. ??

Pooojaaaa
  • 183
  • 1
  • 4
  • 16
  • See [The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead](http://stackoverflow.com/q/13944956) and [Why shouldn't I use mysql_* functions in PHP?](http://stackoverflow.com/q/12859942) – eggyal Mar 05 '16 at 10:15
  • merely changing to mysqli will not necessarily protect you from sql injection. If you have embedded variables directly in the sql ( ie: `where username='$username'` ) then it is still vulnerable and no great improvement on mysql functions. Yes you would need to alter all the sql statements IMO - it's quite a big task as the syntax is slightly different between mysql and mysqli – Professor Abronsius Mar 05 '16 at 10:16
  • `(username='$username)` This is exactly what m doing.. and if mysqli will not protect me from sql injection .. what is safe to use rite now ?? and what about pdo @RamRaider – Pooojaaaa Mar 05 '16 at 10:22
  • 1
    @StillLearning: Have you tried reading the answers to either of the questions to which I have linked? It's rather tedious to copy and paste the same answers to the same questions every time they're asked. – eggyal Mar 05 '16 at 10:24
  • Neither PDO or mysqli offer protection from sql injection if the variables are directly embedded in the sql. You need to use prepared statements to gain maximum protection – Professor Abronsius Mar 05 '16 at 10:26
  • got through ur whole ans @eggyal quite interesting .. i dnt knw a bit about pdo .. so going through the tutorial u ve given their.. will get through it.. thanks much – Pooojaaaa Mar 05 '16 at 10:33

0 Answers0