I have a short PHP script that interacts with a database. The script is currently written for MySQL but needs to be converted to SQL Server. I don’t have experience with SQL Server and think I have done most of it correctly but in one line of the script is:
@mysql_fetch_assoc($result)
What is the SQL Server equivalent of this?
Do I need to edit the query line at all?
$query = 'SELECT * FROM location WHERE dType="' . $ajax_var . '" AND oType="' . $ajax_var2 . '"';
mysql_fetch_assocreturns an associative array of column names mapped to their respective value, row-by-row. For SQL Server you want sqlsrv_fetch_arrayDon’t be afraid of reading the docs. 😉
Cheers