no element found - SQL statement looks good though
anyone see what is wrong with this line of code? using php/mysql
$sqlInsert="INSERT INTO sched_trades_proposed (id,originalDate,originalUserid,originalRot,original_sched_main_id,proposedDate,proposedUserid,propo sedRot,proposed_sched_main_id,timeStampedProposal,randomHash) VALUES('','".$originalDate."',".$_SESSION[userid].",$originalRotation,$original_sched_main_id,'".$proposedDate."',$proposedRad,$proposedRotation,$pro posed_sched_main_id,UNIX_TIMESTAMP(),'".$randomHash."')";
firebug says "no element found" and points to this INSERT statement. I dont see anything wrong with the insert statement. I realize firebug isn't server side. I am still trying to solve the error though. If I comment out this line of code I get no error.
You don't do anything to detect errors from the mysql_query call.
You have a space in one of your property names. You must enclose it in backticks if you intend to use spaces or reserved words (I wouldn't recommend you use either).
First of all, you can't use FireBug to debug PHP code.
So all FireBug is saying is that your PHP code produced something incorrectly. Nearly useless information.
the original id is auto incremented, so I insert a '' as the first column which is kosher.
Well, no, it's really not. It's kind of like a Reformed Jew eating bacon. It's allowed even if frowned upon. The Orthodox answer is that you *MUST* use the keyword NULL there. Or, better, just omit the id field and its value from the INSERT completely.
I don't see the space-in-a-field name that FouLu is referring to. I think it's just because your text lines are too long.
But in any case, what FouLu is saying is do this:
$resultInsert=mysql_query($sqlInsert) or die( mysql_error() );
and then presumably you will see the error message your are getting from the query.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.