RE: [PHP] Empty Page problems
| From: | Gary Ogilvie | Date: | Thu, 19 Jun 2003 14:18:45 +0000 |
| Subject: | RE: [PHP] Empty Page problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152164@lists.php.net to get a copy of this message | ||
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:holmes072000@charter.net]
Sent: 19 June 2003 15:07
To: Gary Ogilvie; php-general@lists.php.net
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\"><b>Attempting To Connect To MSSQL -
> </b><br><br>");
>
> $s = @mssql_connect($myServer, $myUser, $myPass)
> or die("Couldn't Connect To SQL Server On $myServer<br>");
>
> print ("<u>Stage 2</u><br>");
>
> $d = @mssql_select_db($myDB, $s)
> or die("Couldn't Open Database $myDB<br>");
>
> #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 Database<br><br>");
>
> 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