Jump to content

Update not working (sometimes)


websteve

Recommended Posts

I am trying to update a table, but I am getting intermittent errors. If I run the program and change the credit card number, for example, sometimes it works and other times it doesn't. 

Also, if I change the expiration to say, 11/12, it returns some type of decimal sequence. The expiration column is set for Varchar. I verified that the variables are being sent through. If anyone can tell me what I am doing wrong, I would appreciate it.

 

Here's the code:

 

$credit_update = "UPDATE Credit SET Credit_Card_Number='$credit_card_number', Expiration=$expiration WHERE ID = '" . mysql_real_escape_string($cust_id) . "'";

mysql_query($credit_update) or die('Could not connect to credit table: ' . mysql_error());

 

 

 

Link to comment
Share on other sites

OK, that makes sense. Thanks.

 

What about this part:

 

$credit_update = "UPDATE Credit SET Credit_Card_Number='$credit_card_number',

 

The credit card number sometimes is updated and sometimes it doesn't take.

 

Any ideas?

 

- Steve

Link to comment
Share on other sites

So, what is the column definition of Credit_Card_Number?

 

And what exactly is the symptom or error that leads you to believe that "it doesn't take." We only see the information you supply in your posts and "it doesn't take." could mean 3-6 different things, each with a different cause. You must be exact when describing problems.

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.