Jump to content

enter details into a databse


spearchilduser

Recommended Posts

$sql= ("INSERT INTO custcards (username,Card_Number,Card_Type,Card_Name,Card_End) VALUES('$username','$cardnumber','$cardtype','$cardname','$cardend')");

if (isset($_GET['submitted'])) {
  if (checkCreditCard ($_GET['CardNumber'], $_GET['CardType'], $errornumber, $errortext)) {
    $errortext = 'This card has a valid format'; // Default text if card is VALID
$result = mysql_query($sql)){
echo "$errortext"; // Echo/Show this text
      
}
}
else
{
echo '<p align=center>';echo "$errortext"; // Display ERROR Type/Text
echo "ERROR: ".mysql_error();
}

}

The code is to check details beign entered and to make sure thier correct and then print the correcrt message but i also want it to store the details into a table

 

i know i havent got the syntax correct was wondering is anyone can help ?

 

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.