Jump to content

[SOLVED] Trouble Calling From Database


refiking

Recommended Posts

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')";

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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')";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.