0

For some reason, I am unable to store to insert data in the following database table. I am certain the connection is fine since I am successfully retrieving data from this database using select but I seem to have a problem with insert

// Track user data in database
// Array must be converted to strings
$track = "INSERT INTO resources_record (name,email,stage,format,topic,cost,mentor)
          VALUES ('0', '1', '2', '3', '4', 5, '6')";

// Execute track query
 mysqli_query($con, $track);

It just doesn't insert anything.

Any help would be greatly appreciated.

code_legend
  • 3,547
  • 15
  • 51
  • 95
  • What is the structure of the table `resources_record`. Also, for funsies, try: `INSERT INTO \`resources_record\` (\`name\`,\`email\`,\`stage\`,\`format\`,\`topic\`,\`cost\`,\`mentor\`) VALUES ('0', '1', '2', '3', '4', 5, '6')` – ScottMcGready Sep 03 '15 at 01:49
  • 1
    @Your Common Sense what duplicate u found on two different topics? "mysql reserved words vs backticks" and "dev env" – M0rtiis Sep 03 '15 at 04:34
  • 1
    @user3907211, as @ScottMcGready said u should have backticks around coulumn names. also you should understand why. to "escape" reserved words. actually you need them only with `format`. read more http://dev.mysql.com/doc/refman/5.6/en/keywords.html – M0rtiis Sep 03 '15 at 04:38
  • If in doubt, bacticks – ScottMcGready Sep 03 '15 at 04:39

0 Answers0