Results 1 to 7 of 7

Thread: error in your SQL syntax

  1. #1
    Join Date
    Sep 2005
    Location
    selangor
    Posts
    9
    Rep Power
    0

    error in your SQL syntax

    I got this query

    Couldn't execute 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 '23', '6', '6', '6', '24"', '24"'


    from


    $size= $_POST['size'];
    $height= $_POST['height'];
    $weight= $_POST['weight'];
    $bust= $_POST['bust'];
    $waist= $_POST['waist'];
    $hip= $_POST['hip'];
    $inseam= $_POST['inseam'];
    $pant= $_POST['pant'];

    $connection = mysql_connect($host, $user, $password)
    or die("couldn't connect to server");
    $db = mysql_select_db($database, $connection)
    or die("couldn't connect to database");



    $sql = "INSERT INTO body_fit (username, size, height, weight, bust, waist, hip, inseam, pant)
    VALUES '$logname', '$size', '$height', '$weight', '$bust', '$waist', '$hip', '$inseam', '$pant')";

    $result = mysql_query($sql)
    or die("Couldn't execute query.".mysql_error());;


    can someone help me?

  2. #2
    Join Date
    Nov 2003
    Location
    dEpAn PŠ
    Posts
    13
    Rep Power
    0
    Quote Originally Posted by el_idura
    I got this query

    Couldn't execute 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 '23', '6', '6', '6', '24"', '24"'


    from


    $size= $_POST['size'];
    $height= $_POST['height'];
    $weight= $_POST['weight'];
    $bust= $_POST['bust'];
    $waist= $_POST['waist'];
    $hip= $_POST['hip'];
    $inseam= $_POST['inseam'];
    $pant= $_POST['pant'];

    $connection = mysql_connect($host, $user, $password)
    or die("couldn't connect to server");
    $db = mysql_select_db($database, $connection)
    or die("couldn't connect to database");



    $sql = "INSERT INTO body_fit (username, size, height, weight, bust, waist, hip, inseam, pant)
    VALUES '$logname', '$size', '$height', '$weight', '$bust', '$waist', '$hip', '$inseam', '$pant')";

    $result = mysql_query($sql)
    or die("Couldn't execute query.".mysql_error());;


    can someone help me?
    you have an error in this section


    $sql = "INSERT INTO body_fit (username, size, height, weight, bust, waist, hip, inseam, pant)
    VALUES ('$logname', '$size', '$height', '$weight', '$bust', '$waist', '$hip', '$inseam', '$pant')";

  3. #3
    Join Date
    Aug 2001
    Location
    www.ejoe.net
    Posts
    26
    Rep Power
    0
    perhatikan tanda ni --> (
    ader yg tak lengkap (..).. )
    bukanya xda tp tutup ada plak..so tak cuku pair ..perhatikan bebetul

  4. #4
    Join Date
    Sep 2005
    Location
    selangor
    Posts
    9
    Rep Power
    0
    dah letak gak...
    tp still error nih kuar...
    ape maksud nih
    "check the manual that corresponds"

  5. #5
    Join Date
    Mar 2002
    Location
    Sabah, Malaysia
    Posts
    8
    Rep Power
    0

    use PEAR DB, DB_DataObject

    Quote Originally Posted by putera-
    you have an error in this section


    $sql = "INSERT INTO body_fit (username, size, height, weight, bust, waist, hip, inseam, pant)
    VALUES ('$logname', '$size', '$height', '$weight', '$bust', '$waist', '$hip', '$inseam', '$pant')";

    use PEAR DB, DB_DataObject , http://pear.php.net lor, a DB abstraction layer... for more info visit , http://www.ajaxapp.com

  6. #6
    Join Date
    Nov 2003
    Location
    dEpAn PŠ
    Posts
    13
    Rep Power
    0
    Quote Originally Posted by el_idura
    dah letak gak...
    tp still error nih kuar...
    ape maksud nih
    "check the manual that corresponds"
    lepas letak ( tu dia kuar error apa plak?

    cuba tengok bahagian ni

    syntax to use near '23', '6', '6', '6', '24"', '24"'

    dekat 24 tu ada tanda " ada value dekat _POST tu yang simpan value " kot.. full code xde ker...

  7. #7
    Join Date
    Sep 2005
    Location
    selangor
    Posts
    9
    Rep Power
    0
    wokeh..dah tau dah silap kat mane..
    TQ semua

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. error
    By Aileen_g in forum Graphic Design
    Replies: 3
    Last Post: 08-05-2007, 03:06 PM
  2. Internal Server Error - ASP error
    By ladyheart2612 in forum Website Programming
    Replies: 0
    Last Post: 21-07-2005, 09:22 AM
  3. lot of error
    By prozone in forum Website Programming
    Replies: 2
    Last Post: 19-07-2005, 02:39 PM
  4. Help-error
    By hyllda in forum Website Programming
    Replies: 18
    Last Post: 21-10-2003, 12:32 PM
  5. syntax
    By ngaisteve1 in forum Website Design
    Replies: 5
    Last Post: 14-02-2003, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39