Jump to content

Query


june_c21

Recommended Posts

As joel is saying above, you need to provide more information, show the php code where this query is run.

 

Also, make sure you have a value going into every column of your database table. I counted 9 entries from this query, is there exactly 9 columns in your database table?

 

Denno

Link to comment
https://forums.phpfreaks.com/topic/221843-query/#findComment-1148007
Share on other sites

here is my code

 

<?php
include './includes/header.php';

$id = $_GET ['id'];
$names = $_POST ['names'];
$section = $_POST ['section'];
$wo = $_POST ['wo'];
$printer_name = $_POST ['printer_name'];
$toner_code = $_POST ['toner_code'];
$quantity = $_POST ['quantity'];
$remarks = $_POST ['remarks'];
$technician = $_POST ['technician'];
$trainee = $_POST ['trainee'];

$query= "INSERT INTO out( names , section , wo , printer_name , toner_code , quantity , remarks , technician , trainee ) VALUES ('$names','$section','$wo','$printer_name','$toner_code','$quantity', '$remarks','$technician','$trainee') ";
$result = mysql_query($query,$dblink);

$query= "UPDATE master SET qty= qty - $quantity WHERE id= $id";
$result = mysql_query($query,$dblink );

  
  echo "Inventory Successfully Saved. ";
?>

 

the error i get is

 

#1064 - 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 'out( names , section , wo , printer_name , toner_code , quantity , remarks , tec' at line 1

Link to comment
https://forums.phpfreaks.com/topic/221843-query/#findComment-1148133
Share on other sites

INSERT INTO out( names , section , wo , printer_name , toner_code , quantity , remarks , technician , trainee ) VALUES ('$names','$section','$wo','$printer_name','$toner_code','$quantity', '$remarks','$technician','$trainee')

 

I don't think you need to have the information in the brackets after INSERT INTO out.

 

Take out that and see what happens.

 

Denno

Link to comment
https://forums.phpfreaks.com/topic/221843-query/#findComment-1148138
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.