Jump to content


This topic is now archived and is closed to further replies.


Formatting retrieved data from a mysql database

Recommended Posts

Can someone please help me. I would appreciate it very much!

I have a database with artists and their artworks. The fields are among others: artist name, artist year of birth/death. title artwork, year in which artwork was produced, measurements artwork, material of artwork, whether signed/unsigned, price, etc..
When visitors click on for example the A (in the navigation), they get a list of all artists whose lastname starts with an A, with beneath the arist's name the artworks available. When they click on an artwork, they get a new page with the following information :


Alexander Adonixander (1900-1987)
Apollo | 1979 | Unsigned
Oil on canvas | 51 x 55 cm
Euro 12.987,-

What I want is that visitors can navigate via a page numbering to a next page where they can get more information concerning provenance, literature about the arwork/artist, condition of the artwork etc.

I cannot do this with if(strlen($total text first page)>...) then you can click on page numbering 2, where you get the additional info, because the string length of the data retrieved on the first page are different for each artist, of course.

So, for example, is it possible to write in PHP: when the field 'price' has been retrieved from the database (see example above) then the remaining data (provenance, literature etc..) can be viewed on page 2.

Or does someone know another solution??

Thanks in advance!!

Share this post

Link to post
Share on other sites
well you can in your query ONLY select the info you want to present:
[code] SELECT name,birth,title,price, etc.. FROM ...[/code]

Share this post

Link to post
Share on other sites
Of course, that would be for page 2. But I made a cms for my client, so he can manage everything himself. But this solution means I have to make the pagination myself, for every new artist/artwork.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.