Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dsn="SLQSERVER";
- $username="sa";
- $password="";
- //Then you call the odbc_connect function to connect to the database using the
- //appropriate credentials. odbc_exec is then used to send a query to SQL Server:
- $sqlconnect=odbc_connect($dsn,$username,$password);
- $sqlquery="SELECT * FROM Car;";
- $process=odbc_exec($sqlconnect, $sqlquery);
- //Finally, you extract all of the companies from the Customers table and
- //display them onscreen in a list. Once the entire list has been displayed,
- //the connection to the database is closed:
- while(odbc_fetch_row($process)){
- $companyName = odbc_result($process,"*");
- echo "$companyName<br>";
- }
- odbc_close($sqlconnect);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement