Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:55:52+00:00 2026-05-26T11:55:52+00:00

<?php $inv = $_POST[‘inv’]; $box = $inv; $date = $_POST[‘from’]; $mark = $_POST[‘mark’]; $type

  • 0
<?php
$inv = $_POST['inv'];
$box = $inv;
$date = $_POST['from'];
$mark = $_POST['mark'];
$type = $_POST['type'];
$desc = $_POST['desc'];
$machine = $_POST['machine'];
$serial = 'x';
$cmode = $_POST['cmode'];
$t1 = $_POST['t1'];
$t2 = $_POST['t2'];
$t3 = $_POST['t3'];
$t4 = $_POST['t4'];
$t5 = $_POST['t5'];
$t6 = $_POST['t6'];
$org = $_POST['org'];
$plant = $_POST['plant'];
$floor = $_POST['floor'];
$line = $_POST['line'];
$linex = $_POST['linex'];
$group = $_POST['group'];
$oper = $_POST['oper'];
$obs = $_POST['obs'];

echo $box.'<br/>';
echo $date.'<br/>';
echo $inv.'<br/>';
echo $mark.'<br/>';
echo $type.'<br/>';
echo $desc.'<br/>';
echo $machine.'<br/>';
echo $serial.'<br/>';
echo $cmode.'<br/>';
echo $t1.'<br/>';
echo $t2.'<br/>';
echo $t3.'<br/>';
echo $t4.'<br/>';
echo $t5.'<br/>';
echo $t6.'<br/>';
echo $org.'<br/>';
echo $plant.'<br/>';
echo $floor.'<br/>';
echo $line.'<br/>';
echo $linex.'<br/>';
echo $group.'<br/>';
echo $oper.'<br/>';
echo $obs.'<br/>';

$con = mysql_connect("localhost","username","mypassword");
if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db("brisay", $con);
mysql_query("SET NAMES utf8"); 

$sql="INSERT INTO controller (box, date, inv, mark, type, machine, serial, cmode, t1, t2, t3, t4, t5, t6, org, plant, floor, line, linex, group, oper, obs) VALUES('$box','$date','$inv','$mark','$type','$machine','$serial','$cmode','$t1','$t2','$t3','$t4','$t5','$t6','$org','$plant','$floor','$line','$linex','$group','$oper','$obs')";
 if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }

error:
Error: 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 'group, oper, obs) VALUES ('123456','2011-10-07','123456','mark','type','4455','x' at line 1

i have the echos only for debugging…
i am still having an error and there is no explanation for that. Everything is correct…

i have 23 columns in the database..
All the names are correct.. and i still always having error on the insert in columns ‘desk’, ‘oper’.

these columns in the structure are ‘varchar(100)’

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:55:53+00:00Added an answer on May 26, 2026 at 11:55 am

    You shoul try to escape field names if they are reserver words:

    INSERT INTO controller 
    (box, `date`, inv, mark, `type`, machine, serial, cmode, 
     t1, t2, t3, t4, t5, t6, org, plant, `floor`, line, linex, 
     `group`, oper, obs) 
    VALUES
    ('$box','$date','$inv','$mark','$type','$machine','$serial','$cmode',
     '$t1','$t2','$t3','$t4','$t5','$t6','$org','$plant','$floor','$line',
     '$linex','$group','$oper','$obs')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP: $SQL = SELECT goodies FROM stash WHERE secret=' . str_replace(','',$_POST['secret']) . '; Could
I have create a simple grid that retrieves data from a server through php.
php newbie here..I need some PHP help ideas/examples on how to import data from
PHP Version: 5.3.3 I'm using the SOAP extension to pull data from a web
I have this array in php returned from db Array ( [inv_templates] => Array
PHP: function generate_uid() { $uid = mt_rand(); $sql = SELECT user_id FROM user_registration; if
<?php $inventory_in = $db->get_one(SELECT COALESCE(SUM(Qty), 0) FROM inventory Where id=12 AND inv_type = 'in'
PHP Code: $cour = mysql_sql('SELECT c.id, c.category, cc.name, c.fullname,c.summary FROM mdl_course c, mdl_course_categories cc
PHP has a great function called htmlspecialcharacters() where you pass it a string and
PHP's explode function returns an array of strings split on some provided substring. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.