9 messages in com.mysql.lists.mysqlRe: MySQL Data Vanishing with FireFox
FromSent OnAttachments
Matt Neimeyer27 Dec 2006 06:45 
Lemuel Formacil27 Dec 2006 07:00 
Jerry Schwartz27 Dec 2006 07:47 
ViSolve DB Team27 Dec 2006 22:11 
Matt Neimeyer28 Dec 2006 06:32 
Jerry Schwartz28 Dec 2006 07:18 
Peter Brawley28 Dec 2006 07:18 
Jerry Schwartz28 Dec 2006 07:56 
JamesDR28 Dec 2006 08:31 
Subject:Re: MySQL Data Vanishing with FireFox
From:Peter Brawley (pete@earthlink.net)
Date:12/28/2006 07:18:29 AM
List:com.mysql.lists.mysql

Matt,

$SQL = 'INSERT INTO Contacts (ContFirst,ContLast,ContEmail,UserID) VALUES ("' .$_POST["ContFirst"].'","'.$_POST["ContLast"] .'","'.$_POST["ContEmail"].'",'.$MyID.')'; echo $SQL; $result = mysql_query($SQL,$db);

If userid is an int, why quote the $myid value?

Did you check what's echoed against the server log?

PB

-----

Matt Neimeyer wrote:

I think it's your PHP application; how did you "debug" your application?

All this is doing is letting our customer add their contacts to the database. This is on the "quick add" form and asks them to enter a first and last name and an email.

I debugged by re-writing it temporarily to do this...

$SQL = 'INSERT INTO Contacts (ContFirst,ContLast,ContEmail,UserID) VALUES ("' .$_POST["ContFirst"].'","'.$_POST["ContLast"] .'","'.$_POST["ContEmail"].'",'.$MyID.')'; echo $SQL; $result = mysql_query($SQL,$db);

On the theory that the echo shouldn't change the contents of the $SQL variable. Then on the same client machine, I open both browsers and launch the page. In both browsers I can see the exact same statement (including the value of $MyID) on the screen but in IE it works and on FireFox it doesn't.

As soon as I see the SQL on the screen I query directly (not through PHP) to pull out the records and see that UserID is missing.

What data type is column 'C'? Is it ENUM?

Nope. Nothing compilicated... ContFirst,ContLast are Char(30), ContEmail is Char(100), UserID (the one failing) is INT(4). The typical values of UserID (at least when debugging, and still failing) were numbers from 1-20.

Again... since I'm seeing the exact same statement on the screen in the echo, theory has it that the exact same statement is being passed into the mysql_query in the next line.

This is why I'm so baffled. Normally I echo the actual statement and it's obvious what my error is. (Oh... a comma...) OR I echo the statement and see that FireFox handles cookies different, or passes form values different, or truncates $_GET at a different length or some other equally obscure thing but still that the STATEMENT differs and I have something to start tracing from. Here the statement is identical on both browsers and one fails and the other doesn't.

Any other ideas?