You are here: Re: Update all fields « PHP SQL « IT news, forums, messages
Re: Update all fields

Posted by Jim Michaels on 02/24/06 01:50

"UKuser" <spidercc21@yahoo.co.uk> wrote in message
news:1139514275.133348.95370@g43g2000cwa.googlegroups.com...
> Using this code will show the results (the above won't I'm afraid), but
> this displays an error:
>
> for ($i=0; $i<count($_POST['id']); $i++)
> {
> ////LINE 39////// next one

try this:

mysql_query ("UPDATE fig_lookup
SET lowerval='$_POST[f2][$i]',
upperval='$_POST[f3][$i]',
result='$_POST[f4][$i]'
WHERE id=$_POST[f1][$i]");


id shouldn't really have quotes on it if it's an integer.

BTW, when you do an UPDATE ... SET with no WHERE, is sets *all* the entire
table.

> }
> }
>
> while ($l = mysql_fetch_array($resulta, MYSQL_ASSOC))
> { ?>
> <tr>
> <td><input type="text" name="f1[]" value="<?=$l["id"]?>"></td>
> <td><input type="text" name="f2[]" value="<?=$l["lowerval"]?>"></td>
> <td><input type="text" name="f3[]" value="<?=$l["upperval"]?>"></td>
> <td><input type="text" name="f4[]" value="<?=$l["result"]?>"></td></tr>
> <?
> }
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING' in /home/www/nana46.coconia.net/test4.php on line 39
> (line 39 is mysql_query line - marked in code)
>

 

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

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