Jump to content

Sysntax Error


s4salman

Recommended Posts

Hello

 

i am getting this error message, please help me to correct it :

 

Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table (id, name, description, linkdown, pubsite, category, image, os) VALUES ('' at line 1

 

 

The code is as follows :

 

<?php
/// In order
/// you
/// information in this file:
/// Copyright 2012
/// All rights reserved.
include("connect.php");
$name = trim(mysql_real_escape_string($_POST["name"]));
$description = trim(mysql_real_escape_string($_POST["description"]));
$linkdown = trim(mysql_real_escape_string($_POST["linkdown"]));
$pubsite = trim(mysql_real_escape_string($_POST["pubsite"]));
$category = trim(mysql_real_escape_string($_POST["category"]));
$image = trim(mysql_real_escape_string($_POST["image"]));
$os = trim(mysql_real_escape_string($_POST["os"]));

$results = mysql_query("INSERT INTO table (id, name, description, linkdown, pubsite, category, image, os)
VALUES ('', '$name', '$description', '$linkdown', '$pubsite', '$category', '$image', '$os')");
if($results) { echo "Successfully Added"; } else { die('Invalid query: '.mysql_error()); }
?>
<a href="index.php">Back to index</a>

Link to comment
https://forums.phpfreaks.com/topic/269340-sysntax-error/
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.