 |

mel
User
May 26, 2008, 12:39 PM
Post #1 of 5
(270 views)
Shortcut
|
|
How do I display records from just 1 specific region
|
Can't Post
|
|
Hi, I have a section(table) called bios which has 15 fields in, one of these fields is called 'region' In this section will be xxx number of records some will be for north west some will be for south east some will be for south west and so on and so forth Two part question: Q1. How do I get a page called lets say northwestDetails.php to display records from the bios section to display records for just one specific region for example 'north west' Q2. When the records do display I only want three fields to display alongside a thumbnail image and when you click on either the image or a piece of text called ' click here for full details' you get to see the full record Thanks Mel
|
|
|  |
 |

Dave
Staff
/ Moderator

May 26, 2008, 1:31 PM
Post #2 of 5
(267 views)
Shortcut
|
|
Re: [mel] How do I display records from just 1 specific region
[In reply to]
|
Can't Post
|
|
Hi Mel, To show only record from a specific region you can use a MySQL Where query like this: region = "north west" You can either enter that in the code generator (at the bottom under "Filter Results") or in the viewer code like this:
list($records, $recordMetaData) = getRecords(array( 'tableName' => 'bios', 'perPage' => 5, 'where' => 'region = "north west"', )); And to only display 3 fields just remove all the <?php echo ... ?> tags for the fields you don't want displayed and copy the <a href=""> tag around your image as well. Hope that helps. Let me know if you need more details or help with that. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

mel
User
May 26, 2008, 1:45 PM
Post #3 of 5
(264 views)
Shortcut
|
|
Re: [Dave] How do I display records from just 1 specific region
[In reply to]
|
Can't Post
|
|
Hi Mel, To show only record from a specific region you can use a MySQL Where query like this: region = "north west" You can either enter that in the code generator (at the bottom under "Filter Results") or in the viewer code like this: list($records, $recordMetaData) = getRecords(array( 'tableName' => 'bios', 'perPage' => 5, 'where' => 'region = "north west"', )); And to only display 3 fields just remove all the <?php echo ... ?> tags for the fields you don't want displayed and copy the <a href=""> tag around your image as well. Hope that helps. Let me know if you need more details or help with that. Hi Dave, Yes have just been experimenting with the where clause but was getting the syntax wrong now from your example I see where I was going wrong - so all records from north west are now showing great stuff And understand about about stripping out all unrequired echo statements But how do I get these mini listings to link to the actual full individual records? Thanks Mel
|
|
|  |
 |

Dave
Staff
/ Moderator

May 26, 2008, 4:38 PM
Post #4 of 5
(248 views)
Shortcut
|
|
Re: [mel] How do I display records from just 1 specific region
[In reply to]
|
Can't Post
|
|
Usually the code generator will create a link tag like this for you: <a href="<?php echo $newsRecord['_link'] ?>">detail page</a> Note that $newsRecord will be named after your table and have a different name. Try pasting the _link tag back in if you've removed it or attach your viewer file to this thread and I'll tell you what to add if you're not sure. Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

mel
User
May 28, 2008, 10:38 AM
Post #5 of 5
(208 views)
Shortcut
|
|
Re: [Dave] How do I display records from just 1 specific region
[In reply to]
|
Can't Post
|
|
Thanks Dave, All working like a treat Mel
|
|
|  |
|