Jump to content

jamescv7

Members
  • Content count

    13
  • Joined

  • Last visited

Everything posted by jamescv7

  1. Greetings Filemaker users out there. How I can code using PHP API Pagination the records individually? I saw this link http://www.databuzz.com.au/simple-pagination-with-the-filemaker-php-api/ but still figuring out on how to show it properly. Showing different records from first, previous, next and last button function using PHP Thanks.
  2. XML error: No memory at line 1 Greetings, this error occurred when the Filemaker API cannot generate a bunch of records. (1000+ records and above) I've adjusted the time out settings for PHP even the memory limits. Is there any possible solution for this? According to some information, the error turns out that the 10 MB XML scripts is unchangeable. thanks.
  3. XML Error line 1

    What a bummer, I replicate the problem and it seems there is no issue when retrieve even 20k of records. Likely I need to fix the source code again.
  4. XML Error line 1

    Actually I used the reference from formulations Pro http://www.formulationspro.com/pages/products/products_detail.php?id=109 I used the Pagination of navigation links (the next, previous, last and first) where it will show one by one. Therefore despite of 1000+ records that should not caused any drawback as it will show one by one only. Is there any root to fix the XML error? I'm working on a quick development of project where I will create a web version of a filemaker projects.
  5. Of course I'm willing to provide the solution, it seems I took a lot of time to just figure out the simple one. So fortunately managed to purchase an ebook that contains the source code, however not sure if it's allowed to post here,
  6. Never mind I fixed it already. Sometimes you need to purchase an ebook that contains the vital important parts of Filemaker API functions.
  7. I'm little bit confuse on FX and attempt to fix the source code that I posted. However I don't know how to work it correctly. Can you post the whole source code on how the pagination works? This should help other users who are developing apps in PHP using the API itself.
  8. Is FX.php will work on Filemaker 15 version? According to the documentation, the API works from 7 to 14.
  9. I will try to check FX.php So on the code I posted, the error links only to open or close brackets? The error seems pointing when I click next or last which failed to show data on for each loop. (except when it's in the main page)
  10. <?php require_once 'FileMaker.php'; $fm = new FileMaker('Contacts_Carlo', 'armontsys.ddns.net', 'Admin', 'fenix101'); $layouts = $fm->listLayouts(); if(FileMaker::isError($layouts)) { // FileMaker PHP API Error — Alert User. $errorMessage = "FileMaker PHP Error: " . $layouts->getMessage(); } else { // Find all Contact records $request = $fm->newFindAllCommand('FPAM_testpurposeonly'); // Set a Max value. Paging 20 records at a time $max = 1; $skip = (isset($_GET['skip'])); if(!isset($skip)) { $skip = 0; } $request->setRange($skip, $max); // Perform the Find $result = $request->execute(); if (FileMaker::isError($result)) { if ($result->code = 401) { $errorMessage = "There are no Contacts that match that request: " . ' (' . $result->code . ')'; } else { $errorMessage = "Contacts Find Error: " . $result->getMessage() . ' (' . $result->code . ')'; } } else { // Get the found records and setup page navigation links $records = $result->getRecords(); $found = $result->getFoundSetCount(); $fetchcount = $result->getFetchCount(); // $totalpages = ceil($found / $max); $prev = $skip - $max; $next = $skip + $max; if(($skip + $max) > $found) {$next = $skip; } $lastskip = $found - ($found % $max); $firstrecord = $skip + 1; if ($fetchcount == $max) { $lastrecord = (($firstrecord + $fetchcount) - 1); } else { $lastrecord = ($skip + $fetchcount); } $sepbar = " | "; // Get the found records and setup page navigation links $records = $result->getRecords(); $found = $result->getFoundSetCount(); $fetchcount = $result->getFetchCount(); $totalpagesceil = ceil($found / $max); $totalpagesfloor = floor($found / $max); $prev = $skip - $max; $next = $skip + $max; if(($skip + $max) > $found) {$next = $skip; } if($totalpagesceil == $totalpagesfloor) { $lastskip = ($totalpagesceil - 1) * $max; } else { $lastskip = $totalpagesfloor * $max; } $firstrecord = $skip + 1; if ($fetchcount == $max) { $lastrecord = (($firstrecord + $fetchcount) - 1); } else { $lastrecord = ($skip + $fetchcount); } $sepbar = " | "; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title> FileMaker DevCon INT002 Contacts </title> <link rel="stylesheet" type="text/css" media="screen" href="css/glass_grey.css"> <style type="text/css"> form#auth label.error { display: none; margin-top: 5px; color: red;} .appropriateError{ color: red; } .emphasise{ color: red; } </style> </head> <body> <div id="container"> <!-- HEADER --> <div id="header"> <h1> FileMaker DevCon INT002 Contacts </h1> </div></div> <table> <thead> <tr> <th> Customer ID </th> <th> First Name </th> <th> Last Name </th> <th> Country </th> <th> Phone Mobile </th> </tr> </thead> <tbody> <?php $records = $result->getRecords(); $recnum = 1; foreach($records as $contacts_search_row){ $rowclass = ($recnum % 2 == 0) ? "table_row" : "alt_row"; $recid = $contacts_search_row->getRecordId(); $pos = strpos($recid, "RID_!"); if ($pos !== false) { $recid = substr($recid,0,5) . urlencode(substr($recid,strlen("RID_!"))); } ?> <tr> <td><a href='<?php echo "contactdetails.php?recid=$recid";?>'><?php echo nl2br( $contacts_search_row->getField('Company'))?></a></td> <td> <?php echo nl2br( $contacts_search_row->getField('Address'))?> </td> <td> <?php echo nl2br( $contacts_search_row->getField('Phones'))?> </td> <td> <?php echo nl2br( $contacts_search_row->getField('Fax'))?> </td> <td> <?php echo nl2br( $contacts_search_row->getField('Factored'))?> </td> </tr> <?php $recnum++; } /* foreach record */?> </tbody> </table> </div> </div> </body> </html> <div> </div> <div id=”content”> <h1>Contacts List </h1> <div> <?php if ($skip != 0) { echo '<a href="?skip=0">First</a>'.$sepbar; } ?> <?php if ($prev >= 0) { echo '<a href="?skip='.$prev.'">Previous</a>'.$sepbar; } ?> <?php if (($skip + $max) < $found) { echo '<a href="?skip='.$next.'">Next</a>'.$sepbar; } ?> <?php if (($skip + $fetchcount) < $found) { echo '<a href="?skip='.$lastskip.'">Last</a>'; } ?> Fatal error: Call to undefined method FileMaker_Error::getRecords() in C:\xampp\htdocs\Attempt Pagination\paginationattempt.php on line 136 The code shows the data already but when I click next or Last then it turns out an undefined method. Pointing near end Tbody tag
  11. I've tried this link but nowhere I got the process right cause nothing happens.
  12. @ggt667: The information of examples in API of Filemaker are limited (only in official PDF). Unfortunately I have no money to purchase paid ebooks since it contains the information I wanted to look. http://stackoverflow.com/questions/2427115/filemaker-php-next-previous-buttons-on-record-detail-page I found also this but its too limited and barely understand the syntax.
  13. Then how I will show the records one at a time with the use of Session? I'm still new to Filemaker PHP API. None I can see a proper procedure except the pagination showing by batch.
×

Important Information

By using this site, you agree to our Terms of Use.