[FX.php List] Searching a numeric field

Derek Bastille bastille at arsc.edu
Mon Apr 18 18:57:04 MDT 2005


Hi All,
   I'm trying to do something that should be dead simple, but I'm having 
problems with it.  Since I have not seen any mention of it in the list 
archive (yes, I'm new :-) it is probably something I'm doing wrong.  
However, it is slowly driving me mad ...

   In my data table I have a primary key field called pkey$n that I'm 
using to hold the unique keys for the records.  In the file 
proj_detail.php I tried finding the file (the URL would be 
proj_detail.php?id=7 for example):

// Find block for project information
$id = $_GET['id'];
$ProjectQuery = new FX($serverIP,$webCompanionPort,'FMPro7');
$ProjectQuery->SetDBData('ADZE_PDS.fp7','Web_Projects');
...
$ProjectQuery->AddDBParam('pkey$n',$id);
$ProjectData=$ProjectQuery->FMFind();

   This produces a found count of -1.  I then tried
$ProjectQuery->AddDBParam('pkey$n',$id,'eq');

and

$ProjectQuery->AddDBParam('pkey$n',7);

It was only when I finally gave up and redefined the key as a text 
field and used:

$ProjectQuery->AddDBParam('pkey$t',$id,'eq');

That the finds were successful.  I've had the same problem with a 
couple of other tables that have numeric keys.  I also have tried using 
field names that don't include the '$' character (I use $t for text 
fields, $n for numeric, $s for timestamp, etc) and that also did not 
work.  The database is being hosted by FMSA7.

Thanks!
   Derek

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         Derek Bastille | Phone: (907)450-8643
     PO Box 756020, Fairbanks AK, 99775 | Fax:   (907)450-8601
    Arctic Region Supercomputing Center | email: bastille at arsc.edu
User Services Consultant/ISSO-Accounts |        fndlb at uaf.edu
      PGP public key: http://www.arsc.edu/~bastille/dereksKey.txt
----------------------------------------------------------------------
     ARSC Help Desk:  email: consult at arsc.edu  voice: (907)450-8602
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the FX.php_List mailing list