You are here: Re: ok i decided to take Erwin Moller and start a fresh topic and im taking a different approach « PHP Programming Language « IT news, forums, messages
Re: ok i decided to take Erwin Moller and start a fresh topic and im taking a different approach

Posted by so many sites so little time on 11/20/06 01:49

thanks so much for all the help im going to remove the home_id if that
doesnt work i am going to make it null all i am really trying to achive
in the end is a page where a client could enter that they would like
text on their site to be and update the database with that text and a
script that would display that text. i went out tonight and bought
another php book its the php phrasebook by chris wenz. i have quite a
few books on php and or mysql 4 to be exact and none of them really got
what i needed for this through to my head but tonight a sat at borders
with a cup of coffee and read through the section on inserting and
displaying data from a mysql database from the sections of every single
php, and php and mysql book that they had in stock and took notes so i
should be golden if there are anymore problems or errors with this i
will let you guys know so you can be of help and that you all for
helping so much you are all really good people for taking the time to
help me out. : )
Pedro Graca wrote:
> Jerry Stuckle wrote:
> > Norman Peelman wrote:
> >> "so many sites so little time" <kkddrpg@gmail.com> wrote in message
> >> news:1163951865.217385.224180@m73g2000cwd.googlegroups.com...
> >>>// Define the query.
> >>>$query = "INSERT INTO home (home_id, header, body, date_entered)
> ^==1==^ ^==2=^ ^=3^ ^=====4====^
> >>>VALUES ('{$_POST['header']}', '{$_POST['body']}', NOW())";
> ^=========1========^ ^========2=======^ ^=3=^
>
> ERROR 1136 (21S01): Column count doesn't match value count ...
>
> 4 columns (home_id, header, body, and date_entered) and 3 values give
> the error 1136 in my MySQL (v 4.1.10)
>
> >> First problem is you are not entering your home_id at all (it takes a 0 -
> >> zero or a NULL to work), make your $query look like this:
> >
> > Incorrect. It is perfectly valid to not enter home_id in the INSERT
> > statement. The autonum value will be used.
>
> I agree with Norm :)
> The SQL statement from "so many sites so little time" generates an
> error.
>
> The only way to make it valid is to eliminate it from the column
> specification:
>
> $query = "INSERT INTO home (header, body, date_entered)
> VALUES ('{$_POST['header']}', '{$_POST['body']}', NOW())";
>
>
>
> --
> I (almost) never check the dodgeit address.
> If you *really* need to mail me, use the address in the Reply-To
> header with a message in *plain* *text* *without* *attachments*.

 

Navigation:

[Reply to this 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

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