Professional Web Applications Themes

Trouble with sql query - MySQL

Hi, I'm sending the follwoing query to mysql from a php script: ---------------------------------------------------------------------------------------- INSERT INTO affiliates (aff_id, first_name, last_name, main_site_url, monthly_unique_visitors, email_address, phone_number, address, address2, city, state_or_province, zip_code, country, payment_threshold, license_to_spam, password, is_active, signup_date) VALUES ( `tester` , `Fernando` , `Rodríguez Romero` , `http://www.easyjob.net` , `100-999` , `yadaeasyjob.net` , `+34 91 8130869` , `Arturo Soria, 339 P2 2Izq` , `` , `Madrid` , `Madrid` , `28033` , `Spain` , 100, 1, `1492549` , 1,2006-01-23) --------------------------------------------------------------------------------------- And I always get this error: ------------------------------------------ Unknown column 'tester' in 'field list' ------------------------------------------ I don't get it. What am I doing wrong? O:-) Thanks! ...

  1. #1

    Default Trouble with sql query


    Hi,

    I'm sending the follwoing query to mysql from a php script:

    ----------------------------------------------------------------------------------------
    INSERT INTO affiliates (aff_id,
    first_name, last_name, main_site_url, monthly_unique_visitors,
    email_address, phone_number, address, address2, city, state_or_province,
    zip_code, country, payment_threshold, license_to_spam, password, is_active,
    signup_date)
    VALUES ( `tester` , `Fernando` , `Rodríguez Romero` , `http://www.easyjob.net`
    , `100-999` , `yadaeasyjob.net` , `+34 91 8130869` , `Arturo Soria, 339
    P2 2Izq` , `` , `Madrid` , `Madrid` , `28033` , `Spain` , 100, 1, `1492549`
    , 1,2006-01-23)
    ---------------------------------------------------------------------------------------

    And I always get this error:

    ------------------------------------------
    Unknown column 'tester' in 'field list'
    ------------------------------------------

    I don't get it. What am I doing wrong? O:-)

    Thanks!

    BTW, the table affiliates is as follows:



    CREATE TABLE affiliates(
    code INT UNSIGNED NOT NULL AUTO_INCREMENT,
    id VARCHAR(40) NOT NULL,
    first_name VARCHAR(255) NOT NULL,
    last_name VARCHAR(255) NOT NULL,
    main_site_url VARCHAR(255),
    monthly_unique_visitors VARCHAR(25),
    company_name VARCHAR(255),
    email_address VARCHAR(100) NOT NULL,
    phone_number VARCHAR(100) NOT NULL,
    address VARCHAR(255) NOT NULL,
    address2 VARCHAR(255),
    city VARCHAR(255) NOT NULL,
    state_or_province VARCHAR(255),
    zip_code VARCHAR(25) NOT NULL,
    country VARCHAR(100) NOT NULL,
    payment_threshold INT UNSIGNED DEFAULT 100 NOT NULL,
    commission FLOAT DEFAULT 0.4 NOT NULL,
    license_to_spam TINYINT DEFAULT 1 NOT NULL,
    is_active TINYINT DEFAULT 1 NOT NULL,
    signup_date DATE NOT NULL,
    password VARCHAR(40),
    comments MEDIUMTEXT,
    PRIMARY KEY (code),
    UNIQUE UC_id (id),
    INDEX IDX_affiliates_1 (id,email_address,is_active,license_to_spam,commis sion,signup_date),
    FULLTEXT IDX_affiliates_2 (comments));


    Fernando Rodríguez Guest

  2. #2

    Default Re: Trouble with sql query

    Fernando Rodríguez wrote:
    >
    > Hi,
    >
    > I'm sending the follwoing query to mysql from a php script:
    >
    > ----------------------------------------------------------------------------------------
    >
    > INSERT INTO affiliates (aff_id, first_name, last_name,
    > main_site_url, monthly_unique_visitors, email_address,
    > phone_number, address, address2, city, state_or_province,
    > zip_code, country, payment_threshold, license_to_spam,
    > password, is_active, signup_date) VALUES ( `tester` ,
    > `Fernando` , `Rodríguez Romero` , `http://www.easyjob.net` , `100-999` ,
    > `yadaeasyjob.net` , `+34 91 8130869` , `Arturo Soria, 339 P2 2Izq` , ``
    > , `Madrid` , `Madrid` , `28033` , `Spain` , 100, 1, `1492549` ,
    > 1,2006-01-23)
    > ---------------------------------------------------------------------------------------
    >
    >
    > And I always get this error:
    >
    > ------------------------------------------
    > Unknown column 'tester' in 'field list'
    > ------------------------------------------
    >
    > I don't get it. What am I doing wrong? O:-)
    >
    > Thanks!
    >
    > BTW, the table affiliates is as follows:
    >
    >
    >
    > CREATE TABLE affiliates(
    > code INT UNSIGNED NOT NULL AUTO_INCREMENT,
    > id VARCHAR(40) NOT NULL,
    > first_name VARCHAR(255) NOT NULL,
    > last_name VARCHAR(255) NOT NULL,
    > main_site_url VARCHAR(255),
    > monthly_unique_visitors VARCHAR(25),
    > company_name VARCHAR(255),
    > email_address VARCHAR(100) NOT NULL,
    > phone_number VARCHAR(100) NOT NULL,
    > address VARCHAR(255) NOT NULL,
    > address2 VARCHAR(255),
    > city VARCHAR(255) NOT NULL,
    > state_or_province VARCHAR(255),
    > zip_code VARCHAR(25) NOT NULL,
    > country VARCHAR(100) NOT NULL,
    > payment_threshold INT UNSIGNED DEFAULT 100 NOT NULL,
    > commission FLOAT DEFAULT 0.4 NOT NULL,
    > license_to_spam TINYINT DEFAULT 1 NOT NULL,
    > is_active TINYINT DEFAULT 1 NOT NULL,
    > signup_date DATE NOT NULL,
    > password VARCHAR(40),
    > comments MEDIUMTEXT,
    > PRIMARY KEY (code),
    > UNIQUE UC_id (id),
    > INDEX IDX_affiliates_1
    > (id,email_address,is_active,license_to_spam,commis sion,signup_date),
    > FULLTEXT IDX_affiliates_2 (comments));
    >
    >
    You're using a back-tickie (`) before tester. Character values are
    surrounded by single quotes (').

    And BTW - this is NOT a PHP question and shouldn't have been
    cross-posted to comp.lang.php.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  3. #3

    Default Re: Trouble with sql query

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Fernando Rodredguez wrote:
    > ------------------------------------------
    > Unknown column 'tester' in 'field list'
    > ------------------------------------------
    >
    > I don't get it. What am I doing wrong? O:-)
    Use single quotes (''') , no back-quotes* (```) in your query.


    * (Is the name of the ` symbol "back-quote"? I'm not sure right now)

    - --
    - ----------------------------------
    Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

    Jugué con quien no sabía y me llevó cuanto tenía.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQFD1S1y3jcQ2mg3Pc8RAswuAJsE6IrALpd4idQdLqZYhP WLTYUwVwCeNgpG
    1fhvH/jdsUgkix0toFzE6To=
    =e1Yo
    -----END PGP SIGNATURE-----
    Iván Sánchez Ortega Guest

Similar Threads

  1. query trouble
    By heath_edw in forum Coldfusion - Getting Started
    Replies: 9
    Last Post: August 27th, 02:22 AM
  2. query of a query trouble
    By throm in forum Coldfusion Database Access
    Replies: 4
    Last Post: December 2nd, 05:49 PM
  3. Trouble with url variable in query
    By Vampyr_Bytes in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: August 17th, 08:02 AM
  4. Trouble with database query
    By _Roudh in forum Macromedia ColdFusion
    Replies: 2
    Last Post: June 15th, 11:30 PM
  5. Trouble getting data to my DB from the cfinput tag query
    By jsabarese in forum Coldfusion Database Access
    Replies: 0
    Last Post: March 12th, 01:01 AM

Bookmarks

Posting Permissions

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

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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139