December 14, 200421 yr 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
December 16, 200421 yr 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
Create an account or sign in to comment