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
https://forums.phpfreaks.com/topic/259587-enter-details-into-a-databse/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.