 |

sidcam
Novice
Jul 16, 2008, 10:51 PM
Post #1 of 2
(763 views)
Shortcut
|
|
Detail Page- Code for Second Record
|
Can't Post
|
|
New to CMS Builder. Simple question I think. I want to create a Detail Page for a record other than the first record but I can't figure out what to enter into the "Where" clause or how to customize it to work. For this example the table is named "header", and the Second record has a title field named "Test". <?php /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */ require_once "/home/u7/sidcam/html/cmsAdmin/lib/viewer_functions.php"; list($headerRecords, $headerMetaData) = getRecords(array( 'tableName' => 'header', 'where' => whereRecordNumberInUrl(1), 'limit' => '1', )); $headerRecord = @$headerRecords[0]; // get first record ?>
|
|
|  |
 |

Dave
Staff
/ Moderator

Jul 16, 2008, 11:25 PM
Post #2 of 2
(760 views)
Shortcut
|
|
Re: [sidcam] Detail Page- Code for Second Record
[In reply to]
|
Can't Post
|
|
Hi sidcam, Do you want to use the same page (yourPage.php) display a different record or do you want to create a second page that displays the other record? If it's the same page you can just put the record number in the url like this: yourPage.php?123 If it's a different page (otherPage.php) you could hard code it to look up the record by number or field value like this: 'where' => 'num = 123', or: 'where' => 'title = "Test"', Hope that helps. If you're still not sure then let me know some more details about the section your trying to create or what you're trying to do and I'll be happy to give you some suggestions. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
|