Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Please help me see what I'm missing, since I received an error at this row:

"'" . $_POST['credit_card_expiration'] ."',".);

I'm getting a headache of all the characters at the moment.

<?php 
session_start(); // Start session first thing in script
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Connect to the MySQL database  
include "storescripts/connect_to_mysql.php"; 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Untitled Document</title>
</head>

 <body>
  <?php

  //let's create the query
  $insert_query = "INSERT INTO order (".
  "name,".
  "email_address,".
  "membership_type".
  "terms_and_conditions,".
  "name_on_card,".
  "credit_card_number,".
  "credit_card_expiration_data,".
  ") values 
  (".
  "'" . $_POST['name'] . "', ".
  "'" . $_POST['email_address'] . "',".
  "'" . $_POST['membership_type'] . "',".
  "'" . $_POST['terms_and_conditions'] . "',".
  "'" . $_POST['name_on_card'] . "',".
  "'" . $_POST['credit_card_number'] . "',".
  "'" . $_POST['credit_card_expiration'] ."',".);

  //let's run the query
  mysql_query($insert_query);

  ?>
 </body>
</html>
share|improve this question
add comment

closed as off-topic by Paul, Brian Reichle, Vedran Šego, Jamal, Jeff Vanzella Oct 16 '13 at 15:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must contain working code for us to review it here. For questions regarding specific problems encountered while coding, try Stack Overflow. After your code is working you can edit this question for reviewing your working code." – Paul, Brian Reichle, Vedran Šego, Jamal, Jeff Vanzella
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 2 down vote accepted

You shouldn't have that . on that row before the ).

It should be:

"'" . $_POST['credit_card_expiration'] ."',");

You don't need that last . as you're not joining any more text together.

share|improve this answer
    
THanks, I think I have had too many "'., at that time :) –  Onizuka Oct 16 '13 at 19:58
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.