refiking Posted June 7, 2007 Author Share Posted June 7, 2007 Here is the other insert code: $store = "INSERT INTO Records(analyst_id , record_id , b_first_name , b_last_name , c_first_name , c_last_name , address, city , state , zip , loan_amount , rate , cap , mo_pay , new_rate , new_mopay , pay_change , change_date , ltv , lender , telephone , ipaddy , timestamp) VALUES('$analyst_id','$record_id','$bfn','$name','$cfn','$cln','$add','$city','$state','$zip','$la','$iir', '$adjc','$mpay','$nr','$nmpay','$change','$cpdate','$ltv','$lender','$tel','$ipaddy','$dun')"; Quote Link to comment Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 You've got a lot of fields there! Can you check in the `Records` table and check if the records ma123, ma124, and ma125 aren't already there? That could be one reason why the INSERT query is failing. I've had problems with inserting before where I've not been specifying enough fields but I think it depends on how the table is set up but I really am not sure. Quote Link to comment Share on other sites More sharing options...
refiking Posted June 7, 2007 Author Share Posted June 7, 2007 I only have 2 set up so far. ma1 and ma2. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 I'm thinking you may have to add more data into that record and not just the analyst_id. From what I can see `analyst_id` is the main index and you're basically adding another record with no data! Quote Link to comment Share on other sites More sharing options...
refiking Posted June 7, 2007 Author Share Posted June 7, 2007 There are more fields than analyst_id. I think there are 5 in all. Quote Link to comment Share on other sites More sharing options...
refiking Posted June 7, 2007 Author Share Posted June 7, 2007 bump Quote Link to comment Share on other sites More sharing options...
refiking Posted June 7, 2007 Author Share Posted June 7, 2007 Got it working now! Here's what I did: $que = mysql_query("SELECT `analyst_id` FROM `Analysts` WHERE username = '$username'"); while($row = mysql_fetch_assoc($que)){ $analyst_id = $row['analyst_id']; echo $analyst_id; } Then, I did this: $store = "INSERT INTO Records(analyst_id , record_id , b_first_name , b_last_name , c_first_name , c_last_name , address, city , state , zip , loan_amount , rate , cap , mo_pay , new_rate , new_mopay , pay_change , change_date , ltv , lender , telephone , ipaddy , timestamp) VALUES('$analyst_id','$record_id','$bfn','$name','$cfn','$cln','$add','$city','$state','$zip','$la','$iir', '$adjc','$mpay','$nr','$nmpay','$change','$cpdate','$ltv','$lender','$tel','$ipaddy','$dun')"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.