-5

I saw this post, saying that you must not use the mysql_* functions. How can I then use functions like: mysql_query(), mysql_connect() or mysql_real_escape_string() without the MySQL extension(mysql_*)?

Can I do this without PDO, because this questions ask the same, but with PDO

Community
  • 1
  • 1
LightningBoltϟ
  • 1,383
  • 2
  • 10
  • 28
  • there is mysqli extension, http://www.php.net/manual/en/book.mysqli.php – rray Dec 06 '13 at 16:19
  • The whole point of that post is that you shouldn't be using these functions. Your question doesn't make sense. – Barmar Dec 06 '13 at 16:21
  • Your question is answered in the post you referred to. There's an answer that describes all the different extensions that can be used to query MySQL. – Barmar Dec 06 '13 at 16:24

1 Answers1

0

The answer to your question is the following: Utilize the mysqli API as opposed to the mysql API http://us1.php.net/mysqli

There is a bit of learning involved because the functions don't behave exactly the same, but it's for the better.

For example, instead of using mysql_connect() to get your connection you would use http://us1.php.net/manual/en/mysqli.construct.php

Additionally, please follow these steps to make sure you have access to mysqli and PDO, as it's going to vary based on how you installed php http://us1.php.net/manual/en/mysqli.installation.php

So, in summary, what that post you've pointed out is saying is that functions starting with mysql_ are deprecated and to not use them anymore.

Zarathuztra
  • 3,215
  • 1
  • 20
  • 34