[FX.php List] Findall problem
Kathy Mohr
kmohr at ncoesc.org
Mon Apr 21 15:20:08 MDT 2008
Hello,
I am new to the group and have been attempting to learn how to use FX and
PHP to connect Filemaker databases to the web. I've been successful with
many trials and errors. My most recent challenge is setting up a blog
site for an area school. I've tried to get all posts to shows on a page
with comments from the portal on a layout. I'm sending the code to see if
anyone can tell me what I am doing wrong that only one record shows. I can
change the Findall to Findany and I get one record at a time but can
refresh the browser to toggle through all the posts, but I can't get all
posts to show up on a page. Your advice would be greatly appreciated.
<?php
include_once ('FX/FX.php');
include_once ('FX/server_data.php');
include_once ('FX/FX_Error.php');
$view=new FX($serverIP,$webCompanionPort,'FMPro7');
$view->setDBData('NRForum.fp7','Posts');
$view->SetDBPassword('password','webuser');
$viewResult=$view->FMFindall();
foreach($viewResult['data'] as $key=>$viewData);
$comments=new FX($serverIP,$webCompanionPort,'FMPro7');
$comments->setDBData('NRForum.fp7','Comments');
$comments->SetDBPassword('nrforum','webuser');
$comments->AddDBParam('postId',$viewData['postId'][0]);
$commentsResult=$comments->FMFind();
?>
<html>
<head>
<title>New Riegel Forum</title>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="nrforum.css" rel="stylesheet" type="text/css">
</head>
<body>
<center>
<?php
include_once('includes/header.php');
?>
<table width="700" border="0" align="center" cellpadding="0">
<tr>
<td height="18"><div align="right"><font color="#000000" size="2"
face="Arial, Helvetica, sans-serif"> <a href="newCommenter.php">Request
User Account </a> - <a
href="commenterLogin.php?action=logout">Current Users
Login</a></font></div></td>
</tr>
</table>
<br>
</center>
<center>
</center>
<table width="700" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td><table width="700" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td colspan="2" bgcolor="#CCCCCC"><font color="#000000" size="2"
face="Verdana, Arial, Helvetica, sans-serif"><?php echo
$viewData['title'][0]; ?></font><font color="#000000" size="2"
face="Verdana, Arial, Helvetica, sans-serif"> </font>- <font
color="#000000" size="2" face="Verdana, Arial, Helvetica,
sans-serif"><?php echo $viewData['timestamp'][0]; ?> <?php echo
$viewData['postId'][0]; ?></font></td>
</tr>
<tr>
<td width="19"> </td>
<td width="675"><font color="#000000" size="2" face="Verdana, Arial,
Helvetica, sans-serif"><?php echo nl2br ($viewData['body'][0]);
?></font></td>
</tr>
</table>
Found Records:<?php echo $commentsResult['foundCount']; ?>
<table width="600" border="0" align="center" cellpadding="0"
cellspacing="0">
<?php foreach($commentsResult['data'] as $key=>$commentsData) { ?>
<tr>
<td colspan="2" bgcolor="#FFCC34"><font color="#000000" size="2"
face="Verdana, Arial, Helvetica, sans-serif"><?php echo
$commentsData['timestamp'][0]; ?> <?php echo $commentsData['postId'][0];
?></font></td>
</tr>
<tr>
<td width="33"> </td>
<td width="567"><font color="#000000" size="2" face="Verdana, Arial,
Helvetica, sans-serif"><?php echo $commentsData['comment'][0]; ?>
<?php
}
?>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<center>
<br><?php
include_once('includes/footer.php');
?>
</center>
</body>
</html>
Kathleen Mohr
Educational Technologist/Professional Development
North Central Ohio Educational Service Center
Tiffin Center
65 St. Francis Avenue
Tiffin, Ohio 44883
419-447-2929
kmohr at ncoesc.org
More information about the FX.php_List
mailing list