You are here: Re: Multiple Categories « PHP SQL « IT news, forums, messages
Re: Multiple Categories

Posted by R.Lange on 03/19/05 22:46

David Robinson wrote:
> "Tex John" <john@logontexas.com> wrote in message
> news:qaF_d.2230$ot.1745@tornado.texas.rr.com...
>
>>$query = "INSERT INTO database SET ";
>>for ($x = 0; $x < count($test); $x++) {
>> $query .= "column = '".$test[$x]."'";
>> if($x < (count($test) + 1)) $query .= ", ";
>>}
>>$query .= "WHERE foo = 'bar'";
>>
>>You mean like that?
>>
>>John
>>
>
>
> Don't forget to add a space between columns:
>
> ....
> $query .= "column = '".$test[$x]." '";
> ...

This will put a space at the end of the string being inserted into the
database. I doubt that's the desired effect. From his setup, I'd say the
space would be better off in front of the WHERE keyword, like so:

$query .= " WHERE foo = 'bar'";

 

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

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