![]() |
|
|
|||||||
| Database Integration How to use MySql, PostgreSQL, MS SQL, Oracle, and most other databases with PHP. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links |
|
|
|
||||
|
yes
![]() Easiest way I can think of would be to have the query replace the table in the first place. Then when you push the find it button (or whatever) just change your query to reflect either that # as a starting point or limit it to just that record. |
|
||||
|
So are you saying just use query all the time? I have tried that and assigned individual buttons for each iteration, like (next, prev, last) and cant seem to get it to work.
something like this, doesnt complain and will fetch a record but not the right one. It still gets the first one. $this->FetchQuery->SQL = ('SELECT * FROM JOBS'); $this->FetchQuery->open(); $this->FetchQuery->last(); Im flustered and dont understand why they present such methods in the doco, and its non-functioning... aaarg. |
|
||||
|
You have to give it more direction to trim it down. Something like:
Select * from jobs where jobid >= 1543 As for next/prev buttons you might have to track your place in the table yourself to know where to move what is visible. |
|
||||
|
I was looking at that yes, was also looking at ibase_fetch_row to allow iteration through table and to also get users query after using prepare / execute. Is one way better than other as far as overhead, ie result set storage or does it matter all that much?
thanks again! |
|
||||
|
Well I found a way to do it, it implements dbpaginator actions to search the dataset. I feel kinda guilty not using an Actual "QUERY" to do the search, but it works.. and oddly it seems faster to manually look thru dataset..
// search dataset for matching JOB ID, usng Paginator actions to move thru records. // this makes it sequentially correct to user, after a successfull record search, // user can then navigate thru dataset from that point... function FetchButtonClick($sender, $params) { $recfound = null; //start at first record... $this->DBPaginator1->linkClick('first'); do { // fetchId is editbox entry user entered... if ($this->FetchId->Text == $this->FetchQuery->Fields["I_JOBID"]) {$recfound = 1; break;} // no match at that record.. goto next rec $this->DBPaginator1->linkClick('next'); } while (!$this->FetchQuery->EOF); // show warning label if no record / data match....... if( $recfound != 1 ) {$this->DBPaginator1->linkClick('first');$this->Noidlabel->Visible = true; return false;} // echo $this->FetchId->Text; // echo $this->FetchQuery->Fields["I_JOBID"]; } |
|
||||
|
Its simplistic, but this was all I was trying to do... user didnt want to use a grid list.
http://forums.delphi-php.net/attachm...1&d=1222346724 |