Mysql insert problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All, 

I have a form which submits technical requests. It worked fine on an
old linux box using Mysql 3 series but recently we switched to windows
2003 server SP1 using Mysql 4.1.10. It was doing this before the
service pack. I get the form values and then insert them into a table.
Sometimes it works and sometimes it dies. I don't know where to look
to fix this. Here is my code:

<?php 

$Email = $_POST['Email'];
$Phonenumber = $_POST['Phonenumber'];
$RoomNo = $_POST['RoomNo'];
$Situation = $_POST['Situation'];
$type = $_POST['type'];

if (!(  (empty($Phonenumber)== TRUE) || (empty($Email)== TRUE) ||
(is_email($Email) == false)  )   )
{
	$ip = $_SERVER['REMOTE_ADDR'];
        $DateRec = date("Y") ."-".date("m")."-".date("d");
        $TimeRec = date("H").":".date("i").":".date("s");
        // initialize database connection 
        include ('../../db.inc');
        $connection = mysql_connect($Host,$User,$Password) or
die("Invalid server or user");
        // select database 
 
        mysql_select_db("techsupport", $connection); 
 
        //formulate and run query 
        $query = "insert into
techsupport(Completed,Phonenumber,RoomNo,Email,Situation,DateRec,TimeRec,ip)
        values('N','$Phonenumber','$RoomNo','$Email','$Situation','$DateRec','$TimeRec','$ip')";
 
        $result = mysql_query($query,$connection) or die("Couldn't
Insert into table techsupport");

        $WONumber = mysql_insert_id(); 

etc...

Any help would be appreciated.

Thanks - Frank

-- 
Frank Miller
Webmaster and Computer Specialist
Texas A&M Uiversity-Texarkana
Phone/Voice Mail 9032233156
Fax 9032233139
Web Page www.tamut.edu

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux