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 = @mysql_connect( "localhost", "username", "password" )
or die( "Err:conn");
$rs = @mysql_select_db( "phptest", $conn)
or die( "ERR:Db");
$sql = "select * from vwStudent where student_id=\"$student_id\" ";
$rs = mysql_query( $sql, $conn )
or die( "Could not execute Query");
while ( $row = mysql_fetch_array( $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?
<% 'Dimension variables Dim Con 'Holds the Database Connection Object Dim rsServers 'Holds the recordset for the records in the database Dim 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,3 Set objRS = Server.CreateObject("ADODB.Recordset") strSQL= "select * from ReviewTarg where id='" & id & "'" objRS.Open strSQL, con, 2, 2 objRS.movefirst objRS("new_target") = request.form("new_target") objRS.Update set RS=Server.CreateObject("ADODB.recordset") RS.Open "tbl_progreviewtarg", Con, 2,3 RS.AddNew RS("target_id") = request.form("target_id") rs("review_id")=review_id+1 RS("prev_target") = request.form("new_target") RS.Update %>