Jump to content


Photo

Formatting retrieved data from a mysql database


  • Please log in to reply
2 replies to this topic

#1 erikjan

erikjan
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 26 July 2006 - 06:14 PM

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 :

Example:

[IMAGE OF ARTWORK]
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!!



#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 26 July 2006 - 06:19 PM

well you can in your query ONLY select the info you want to present:
SELECT name,birth,title,price, etc.. FROM ...

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 erikjan

erikjan
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 26 July 2006 - 06:25 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users