You are here: Re: My first php program « PHP SQL « IT news, forums, messages
Re: My first php program

Posted by Captain Paralytic on 10/16/06 14:55

spacerat wrote:
> I am using ADODB "http://adodb.sourceforge.net/" to get $results.
>
> i then use
>
> foreach ($results as result) {
>
> <td><?php echo $result['value1']; ?></td>
> <td><?php echo $result['value2']; ?></td>
>
> }
>
> now i need to parse a $result['value1'] in a $_SESSION['value1'] that
> needs to be used in another select statement.
>
> i cant use <td><?php $_SESSION['value1'] = $result['value1'];
> ?></td>
> because that just stores the last "value1" into $_SESSION.
> and the same goes for <td><?php $result[0]['value1']; ?></td>
>
> any ideas im going crazy here :(

You're not making a great deal of sense here.

First of all the "foreach ($results as result) {" would not work as it
should be "foreach ($results as $result) {"

Next the code would not output "<td>" or "</td>" as these are within
part of the php parsing (assuming that the foreach is part of it).
Leading on from that the "<?php" after the "<td>" shouldn't be there,
as it is already being executed by php.

Finally you say " i cant use <td><?php $_SESSION['value1'] =
$result['value1']; ?></td> because that just stores the last "value1"
into $_SESSION."
But you only said that you wanted to store "a" $result['value1'] and
the last one is as much a $result['value1'] as any other one. You then
go on to say that it is the same for $result[0]['value1']. The only way
that this can be true is if there is only one result row.

So how about thinking about this and telling us precisely what you want
to achieve?

 

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

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