Round Posted October 27, 2006 Share Posted October 27, 2006 I am currently writting a website to run from our main database which is a microsoft sql 2000 database.At the moment I have apache on my machine with mysql DB so I can test queries and how the information is displayed on the page. I have created tables in the mysql database with the same names, column names and data stored within them as the actual main db.As I have never ran a site querying a microsoft sql db, so will all my code work when I upload the site to run from the main server? Alot of my code is currently using mysql code:- #connect to db $conn = @[i][b]mysql_connect[/b][/i]( "localhost", "username", "password" ) or die( "Err:conn"); #select db $rs = @[i][b]mysql_select_db[/b][/i]( "phptest", $conn) or die( "ERR:Db"); #create query $sql = "select * from vwStudent where student_id=\"$student_id\" "; #exe query $rs = [i][b]mysql_query[/b][/i]( $sql, $conn ) or die( "Could not execute Query"); #retrieve data while ( $row = [i][b]mysql_fetch_array[/b][/i]( $rs ) )Am I going to have to change this? If so how and what to?I have found this code in some asp pages we are currently using, is any of this something I need to consider?[code]<% 'Dimension variablesDim Con 'Holds the Database Connection ObjectDim rsServers 'Holds the recordset for the records in the databaseDim strSQL 'Holds the SQL query to query the database set con=Server.CreateObject("ADODB.Connection")con.open "PROVIDER=SQLOLEDB;DATA SOURCE=servername;UID=username;PWD=password;DATABASE=dbname "set rsStu=Server.CreateObject("ADODB.recordset")strSQL = "SELECT * from Student where student_id='" & request.querystring("student_id") & "'"rsStu.Open strSQL, Con,3,3Set objRS = Server.CreateObject("ADODB.Recordset")strSQL= "select * from ReviewTarg where id='" & id & "'"objRS.Open strSQL, con, 2, 2objRS.movefirstobjRS("new_target") = request.form("new_target")objRS.Updateset RS=Server.CreateObject("ADODB.recordset")RS.Open "tbl_progreviewtarg", Con, 2,3RS.AddNewRS("target_id") = request.form("target_id")rs("review_id")=review_id+1RS("prev_target") = request.form("new_target")RS.Update%>[/code]Thanks Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.