-2

I am managing a website which is built a year or two back. The whole project is based on PHP and mysql is used to connect to the databases. It was performing fine until recently it stopped working. I did some tweaking and found that there is some problem with the database connect file. I replaced the mysql_connect with mysqli_connect and some part of the website started working. Ofcourse, everything will not work since it is built on mysql syntax. Now, it is impossible for me to replace all the codes with mysqli syntax.

So is there a way to get the website working, keeping the mysql_connect in the database connect file. And what might be the reason of this issue?

Any help is appreciated Thanks.

  • 3
    you're probably mixing mysql_ with mysqli_, and/or didn't pass the db connection to functions that require it in mysqli_. But we won't know that for sure till we see your entire code. – Funk Forty Niner Dec 25 '16 at 04:09
  • if you're going to want to run under mysql_, then you'll need a PHP version that still supports that api and not mix in any mysqli_. – Funk Forty Niner Dec 25 '16 at 04:12
  • Actually dear... You have mixed the MySQL and MySQI .... It's not a perfect way... You should use ... Mysqli... Syntax every where... If u didn't want to it in mysqli then start it with MySQL syntax – Kumar Rakesh Dec 25 '16 at 04:23
  • Hello all. Thank you for your inputs. However, the problem is different here. I am managing an already created website. And the website is built on mysql syntax. But until recently mysql codes stopped working. I can infer that because I tried a new code in mysqli and it worked. This issue may have happened because the server stopped supporting mysql. How often do servers do that? Fred -ii-, I hope now it is clear that my question is different than the one you mentioned. – Kishor Malakar Dec 25 '16 at 13:40

1 Answers1

-1

about MySql original:MySql original php doc

This extension is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. Instead, either the mysqli or PDO_MySQL extension should be used. See also the MySQL API Overview for further help while choosing a MySQL API.

so... if you still want to use MySql original library to connect to your database you must use PHP version uder 7.0.0

another idea is use software to automate find and replace string in file fnr.exe so u change mysql_connect to mysqli_connect easily

areiilla
  • 107
  • 2
  • 7