kele Posted December 14, 2004 Posted December 14, 2004 Two snippets of code below - 1st is to enter search criteria 2nd to process that search 1---------------- <html> <head> </head> <body> <br><form method='post' action='Details.php'> topic<input type='text' name='topic' value=''><br> <input type='submit' name='submit' value='Submit'> </form> </body> </html> 2--------------------------- <?php include_once('FX/FX.php'); include_once('FX/FMErrors.php'); include_once('FX/server_data.php'); $groupSize='50'; if($type=='next'){ $skipSize=$skipSize + $groupSize; } if($type=='prev'){ $skipSize=$skipSize - $groupSize; } $FindTopic=new FX($serverIP,$webCompanionPort,'FMPro5/6'); $FindTopic->SetDBData('judgesforum.fp5','cgi',$groupSize); $FindTopic->AddDBParam('Topic',$topic); $FindTopic->AddSortParam('Created','descend'); $FindTopic->FMSkipRecords($skipSize); $FindTopicResult=$FindTopic->FMFind(); echo $FindTopicResult['errorCode']; foreach($FindTopicResult['data'] as $key=>$FindTopicData); ?> <html> <head> </head> <body> <table border='1'> <tr> <td>Created</td><td>Time</td><td>Topic</td><td>Discussion</td><td>Comment</td></tr> <? foreach($FindTopicResult['data'] as $key=>$FindTopicData){ ?><tr><td><? echo $FindTopicData['Created'][0]; ?></td><td><? echo $FindTopicData['Time'][0]; ?></td><td><? echo $FindTopicData['Topic'][0]; ?></td><td><? echo $FindTopicData['Discussion'][0]; ?></td><td><? echo $FindTopicData['Comment'][0]; ?></td></tr> <? } ?></table> <? foreach($FindTopicResult['data'] as $key=>$FindTopicData){ ?> <br><? } ?></body> </html> -------------------------- I am not getting any results with the search (although the search criteria is available in db). I'm sure it must be something stupid simple but I can't see the forest for the trees. TIA - -Kele
FMWebschool Posted December 16, 2004 Posted December 16, 2004 Hi Kele, There are a couple of things here that should be fixed. In your second request, you reference a variable $skipSize which is not declared. Try either setting a specific value as the variable $skipSize or entering a number for the parameter. Also, it looks like you have part of the solution for previous/next in lines 8 and 9, but nothing else on the page indicates use of these values so they can be removed. In kindness, Allyson FMWebschool
Recommended Posts
This topic is 7352 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now