Connection problem with SQL Server

Hi,
I am trying to move the database from MySQL to SQL Serve 2008R2 and created a ODBC connection which is working fine with MS Access (and showing connect in the below coding).
Now, when I am trying to run the below dropdown coding with SQL Server connection it’s not showing no data in the dropdown, but the same coding is showing the data with MySQL database?
Is there any coding difference when we change the databases server or am I missing something in the below dropdown?
Any help would be highly appreciated.
Thanks,
Amir

<?php $conn = odbc_connect('UWSQL_NCL_Analysis','',''); if ($conn) { echo "Connected"; } else { echo "Failed"; } // END Secure Connection Script $tCompany_SQLselect = "SELECT "; $tCompany_SQLselect .= "* "; $tCompany_SQLselect .= "FROM "; $tCompany_SQLselect .= "[NT02\Amir_Ayub].[type]"; $tCompany_SQLselect .= "Order By types "; $tCompany_SQLselect_Query = mysql_query($tCompany_SQLselect); //phpinfo(); echo ''; echo ''; echo '..select type..'; while ($row = mysql_fetch_array($tCompany_SQLselect_Query, MYSQL_ASSOC)) { $ID = $row['ID']; $preName = $row['types']; echo ''.$preName.''; } mysql_free_result($tCompany_SQLselect_Query); echo ''; echo ''; echo '';

I would start with using try/catch, and trying to figure out what the error really is.
http://php.net/manual/en/language.exceptions.php
http://www.w3schools.com/php/php_exception.asp

Sponsor our Newsletter | Privacy Policy | Terms of Service