|
Posted by Shelly on 10/24/07 17:50
"Daniel" <d_pineault@hotmail.com> wrote in message
news:1193245668.179512.149720@q3g2000prf.googlegroups.com...
> Shelly,
>
> I had this in the back of my head, but do not know how to approach
> it. How can you build an array in memory an change the text
> accordingly. Any chance you could give an example?!
>
> Thank you,
>
> Daniel
Show us your code for that page. It would make things easier for people to
help. Specifically, exactly what code are you using to refresh the enlarged
image area?
In **general**, one way to build the array (put in your appropiate error
checking, of course) is:
$res = $mysql_query("the_query_string", the_db_handle);
$numElementInArray = mysql_num_rows($res);
$theArray = array();
for ($i=0; $i<$numElementInArray; $i++) {
$row = mysql_fetch_array($res);
$theArray[$i] = $row['identifier'];
}
Then in the appropriate field in the html area you might have something
like:
<p><?php echo $theArray[$i]; ?></p>
where, of course, $i corresponds to the index of the particular thumbnail
selected (its value).
More or less, this is the kind of thing you would be doing.
[Back to original message]
|