I don't know what the problem is. I have used this script before with
MSSQL with no problems - only this morning in fact. I am VERY new to PHP
so I am still trying to get the hang on it.
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: 19 June 2003 15:07
To: Gary Ogilvie; [EMAIL PROTECTED]
Subject: Re: [PHP] Empty Page problems
Can anyone tell me what is wrong with my PHP script? I am trying to
add
information to an MSSQL database from a separate HTM file. The script
it
as follows:
How about you tell us what the problem is? What is the result of this
script? What are you expecting the result to be? Take away the @ symbols
so
you'll see errors if there are any. Add some debugging to track the
progress
through the script
---John Holmes...
?php
$myEmployeeName=$_GET['name'];
$myEmployeeDept=$_GET['department'];
$myEmployeeNotes=$_GET['notes'];
$myEmployeeCTP=$_GET['ctp_op'];
$myServer = 192.92.0.248;
$myUser = repro;
$myPass = repro;
$myDB = repro;
error_reporting(E_ALL);
print (p class=\text\bAttempting To Connect To MSSQL -
/bbrbr);
$s = @mssql_connect($myServer, $myUser, $myPass)
or die(Couldn't Connect To SQL Server On $myServerbr);
print (uStage 2/ubr);
$d = @mssql_select_db($myDB, $s)
or die(Couldn't Open Database $myDBbr);
#this is the create bit
print (Connected - Attempting To Create Employee...br);
if ($mYEmployeeCTP == on) {
$query = INSERT INTO users (name, department, notes, ctp_op)
VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes',
'Y');
$result = mssql_query($query)
or die(Creating Employee Failed);
} else {
$query = INSERT INTO users (name, department, notes, ctp_op)
VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes',
'N');
$result = mssql_query($query)
or die(Creating Employee Failed);
}
print (Employee Added To Databasebrbr);
print (a href=\index.htm\ class=\link\Go back to
index/a/p);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php