Reply to Re: Trouble with sql query

Your name:

Reply:


Posted by Jerry Stuckle on 01/23/06 21:13

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` ,
> `yada@easyjob.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,commission,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.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация