473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

To enter multiple serialize textbox value in table column in php

all respected
i have just a php code and this file is saved by "check.php"

Expand|Select|Wrap|Line Numbers
  1. <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> <form id="form1" name="form1" method="post" action="http://example.com/checkcon.php"> <table width="335" border="1" cellspacing="0"> <?php
  2. $i=0;
  3. while ($i < 5) {
  4.  
  5. ?> <tr> <td width="193"></label> <input type="text" name="name[]" id="name" /></td> </tr> <?php
  6. $i++;
  7. }
  8. ?> </table> <p> <input type="submit" name="submit" id="submit" value="Submit" /> </p> </form> </body> </html>
and "checkcon.php" is
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     session_start();
  3.     include('connection.php');
  4.     if (isset($_POST)) {
  5.    $name = serialize($_POST['name']);
  6.    $query = mysql_query("INSERT INTO check(name) VALUES ('$name')") or die(mysql_error());
  7.     }
  8.  
  9.  
  10.  ?>
i knew connection is ok but when i run this program it gives


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 'check VALUES ('a:5:{i:0;s:2:"dd";i:1;s:2:"dd";i:2;s:2:"dd";i:3; s:2:"dd";i:4;s:1:' at line 1 this type error plese solv my problem
thanks
Oct 16 '12 #1
1 3494
Dormilich
8,658 Expert Mod 8TB
"check" is a reserved keyword in MySQL.

for a quick'n'dirty fix, quote the name appropriately (`), better rename it.

tip for debugging SQL, usually the error is at the beginning of the quoted line.
Oct 16 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nick | last post by:
Is it possible to have multiple auto increments in one column? Say I have two tables... 1. table 'messageboards' with fields ('id' , 'name') 2. table 'messagethreads' with fields ('id' ,...
2
by: Dan Sikorsky | last post by:
How can we tell if the value in a FormView EditItemTemplate TextBox has changed from its initial value so that we know if we have to update the corresponding db table column value? -- Thank you...
1
by: Pradeep83 | last post by:
Hi All How to create a multiple coulmns inside a table in postgres database. For illusturation i have shown below ,how to create a table like this (below) in postgres database. Main...
13
by: rupak | last post by:
Hi! I have a multiple selection of checkboxes <input type='checkbox' name='coffee' id='col1' value='Address'/> <input type='checkbox' name='coffee' id='col2' value='Name'/> <input...
8
by: mguy27 | last post by:
We have about 2 dozen security officers who patrol about 120 buildings. They find defective or unlocked doors and write a "Trouble Report" on the door. This card gets turned in, where I have designed...
3
by: santoshjsh | last post by:
hello everyone, i have a gridview in which i have multiple checkboxes in a single column. means for every row in the gridview i have four checkboxes in one column e.g Add, Delete, Print,...
2
by: Archanak | last post by:
Hi, I have one common text box to get email id. I have 2 forms and both form action connects to different programs. I want to use this textbox value(i.e email id) only for both the forms. How...
3
by: buterfly0707 | last post by:
hi evryone.. i want to get the text box value to list box . And also i want this textbox value enter into the dabasex table called Area and @ th esame time insert this value to List box. here is...
1
by: omaragainonthetrack | last post by:
public void InsertPlannedMaterialMasterRequest(int id, string requestDocument, string requestDescription, string requestType, string hodApproval, int companyCode, string hodRemarks, string...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.