I currently have a large web application that connects to MSSQL to retrieve its data. This web application contains hundreds of .php files. I have a new client, and he does not want to use MSSQL, but MySQL instead.
I searched and found many articles on how to transfer data. But that is not my problem. I know how to do this, in addition, we will start with an empty database, with the exception of a few default directories.
I need to know if there is a way to automatically change the mssql_query code to mysqli code. For instance:
$SqlText = 'SELECT a, b, c FROM table WHERE x=y'; if (!$result = mssql_query($SqlText) { die('Error'); } while ($row = mssql_fetch_assoc($result) { echo '<td>' . $row['a'] . '</td>'; echo '<td>' . $row['b'] . '</td>'; echo '<td>' . $row['c'] . '</td>'; }
In something like:
$SqlText = 'SELECT a, b, c FROM table WHERE x=y'; if (!$result = mssqli_query($db, $SqlText) { die('Error'); } while ($row = mssqli_fetch_assoc($result) { echo '<td>' . $row['a'] . '</td>'; echo '<td>' . $row['b'] . '</td>'; echo '<td>' . $row['c'] . '</td>'; }
Also, as you can see, I used the old mssql_query code, which is not even supported in newer versions of PHP. Is there at least a tool that can change my code from mssql_query to a new version of sqlserv_query commands?
Any help is greatly appreciated.
source share