In message <[EMAIL PROTECTED]>, whoisquilty
<[EMAIL PROTECTED]> writes
>I've tried what Rajesh suggested, but I don't think I did it properly. Here is 
>the code that I 
>tried and it gave me an error in my SQL syntax.

Rajesh thought that your data was in an array, but you tell us that it
is in a SQL database.

>
>
>while ($photo = mysql_fetch_array($photoresult))
>{
>$copy1 = $photo;
>$copy2 = $photo;
>
>$next_value = next($copy1);
>$prev_value = prev($copy2);

You have taken the data from the database, and created an array that
holds all the fields of one database record.  

Imagine a spreadsheet.  $photo contains information about one horizontal
row of information.  The "while" takes you down the spreadsheet.

next() moves you one cell to the right along the horizontal row.  prev()
moves you once cell to the left, so you can see that it doesn't work
here.  You want to know what is in the row above, and in the row below.

OK, you have a number of rows (a number of records), in $photoresult
(you don't say how many), and you are putting each record into a
separate table.

Apart from the "while", I would say that you are trying to display one
picture per page.  Is that correct?  If it is one picture per page, then
make the first line
>while ($photo = mysql_fetch_array($photoresult))
into 
$photo = mysql_fetch_array($photoresult)
and remove the final, matching }

Then tell us what the query is that you used to get $photoresult, and
the answer will be within sight.

-- 
Pete Clark

Sunny Andalucia
http://www.hotcosta.com/comm_1.htm

Reply via email to