Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fbsql_data_seek(3) [php man page]

FBSQL_DATA_SEEK(3)							 1							FBSQL_DATA_SEEK(3)

fbsql_data_seek - Move internal result pointer

SYNOPSIS
bool fbsql_data_seek (resource $result, int $row_number) DESCRIPTION
Moves the internal row pointer of the FrontBase result associated with the specified result identifier to point to the specified row num- ber. The next call to fbsql_fetch_row(3) would return that row. PARAMETERS
o $ result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3). o $row_number - The row number. Starts at 0. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 fbsql_data_seek(3) example <?php $link = fbsql_pconnect("localhost", "_SYSTEM", "secret") or die("Could not connect"); fbsql_select_db("samp_db") or die("Could not select database"); $query = "SELECT last_name, first_name FROM friends;"; $result = fbsql_query($query) or die("Query failed"); // fetch rows in reverse order for ($i = fbsql_num_rows($result) - 1; $i >=0; $i--) { if (!fbsql_data_seek($result, $i)) { printf("Cannot seek to row %d ", $i); continue; } if (!($row = fbsql_fetch_object($result))) continue; echo $row->last_name . $row->first_name . "<br /> "; } fbsql_free_result($result); ?> PHP Documentation Group FBSQL_DATA_SEEK(3)

Check Out this Related Man Page

FBSQL_NEXT_RESULT(3)							 1						      FBSQL_NEXT_RESULT(3)

fbsql_next_result - Move the internal result pointer to the next result

SYNOPSIS
bool fbsql_next_result (resource $result) DESCRIPTION
When sending more than one SQL statement to the server or executing a stored procedure with multiple results will cause the server to return multiple result sets. This function will test for additional results available form the server. If an additional result set exists it will free the existing result set and prepare to fetch the words from the new result set. PARAMETERS
o $ result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3). RETURN VALUES
Returns TRUE if an additional result set was available or FALSE otherwise. EXAMPLES
Example #1 fbsql_next_result(3) example <?php $link = fbsql_connect("localhost", "_SYSTEM", "secret"); fbsql_select_db("MyDB", $link); $SQL = "Select * from table1; select * from table2;"; $rs = fbsql_query($SQL, $link); do { while ($row = fbsql_fetch_row($rs)) { } } while (fbsql_next_result($rs)); fbsql_free_result($rs); fbsql_close($link); ?> PHP Documentation Group FBSQL_NEXT_RESULT(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Format the result driven from a SQL Query

Hi All, I want to format the result driven from the query into neat format. For example pls find the below code, #! /bin/sh result=' sqlplus -s uname/passwrd@DBname select no,name,address,ph_no, passport_no,salary,designation from emp_table where salary>1000; exit EOF' ... (8 Replies)
Discussion started by: little_wonder
8 Replies

2. Shell Programming and Scripting

File splitter by nth row

I need to split a file into n separate files of about the same size. The way the file will be split is at every nth row, starting with the first row, that row will be cut and copied to it's corresponding new file so that each file has unique records. Any 'leftovers' will go into the last file. e.g.... (4 Replies)
Discussion started by: sitney
4 Replies

3. Solaris

How to delete a row in a file

(8 Replies)
Discussion started by: natraj005
8 Replies

4. Shell Programming and Scripting

select always the first row

Hi, I have an output like this: #CMD Output: user1 user2 user3 user4 How can I select ONLY the first row? Thanks (4 Replies)
Discussion started by: iga3725
4 Replies

5. Shell Programming and Scripting

awk - Matching columns between 2 files and reordering results

I am trying to match 4 colums (first_name,last_name,dob,ssn) between 2 files and when there is an exact match I need to write out these matches to a new file with a combination of fields from file1 and file2. I've managed to come up with a way to match these 2 files based on the columns (see below)... (7 Replies)
Discussion started by: ambroze
7 Replies

6. Shell Programming and Scripting

Remove comma and next rows beginning from the end

Hello friends, I have a file which consists of many rows, I use a couple of commands to convert it so i can use in a database query for filtering. I need the first columns (msisdns) in a row, seperated with commas, 9855162267,4,5,2010-11-03 17:02:07.627 9594567938f,5,5,2010-11-02... (9 Replies)
Discussion started by: EAGL€
9 Replies

7. Shell Programming and Scripting

row Comparison

(5 Replies)
Discussion started by: number10
5 Replies

8. Shell Programming and Scripting

String manipulation row by row

Dear masters, I stuck again in a very tricky situation,so need your valuable inputs. I have a file having rows as below: _Db _Database 1023 1 1 1 17.0B 0.2 1.0 _Field _Field-Name 3 2 2 11 56.2K 64.1 ... (5 Replies)
Discussion started by: patric2326
5 Replies

9. Shell Programming and Scripting

Sort each row (horizontally) in AWK or any

Hello, How to sort each row in a document with numerical values and with more than one row. Example Input data (file1.txt): 4 6 8 1 7 2 12 9 6 10 6 1 14 5 7 and I want the the output to look like this(file2.txt): 1 4 6 7 8 2 6 9 10 12 1 5 6 7 14 I've tried sort -n file1.txt >... (12 Replies)
Discussion started by: joseamck
12 Replies

10. Shell Programming and Scripting

Summing data on N. row of each line

Hi friends, lets assume that I have lines of data as follows rico 12 bct 58 pot 65 vft 41 dek 45 kbt 13 her 35 ubr 14 . . . . . . . . . . . . I want to calculate the sum of the numbers at the 2. row of each... (6 Replies)
Discussion started by: rpf
6 Replies

11. Shell Programming and Scripting

Remove duplicates and update last 2 digits of the original row with 0's

Hi, I have a requirement where I have to remove duplicates from a file based on the first 8 chars (It is fixed width file of 10 chars length) and whenever a duplicate row is found, its original row's last 2 chars should be updated to all 0's. I thought of using sort -u -k 1.1,1.8... (4 Replies)
Discussion started by: farawaydsky
4 Replies

12. UNIX for Dummies Questions & Answers

print first and last row

Hello everybody, I would like to ask you, how to print first and last row from input (not file). I want to get first and last name of file from directory sorted by name, which contains files e.g: ab.txt fg.txt bc.txt and the output should be ab.txt and fg.txt. I used something... (4 Replies)
Discussion started by: satin1321
4 Replies

13. Shell Programming and Scripting

awk find the first matching row

I would like to find the first matching row and continue to search from the matching row. if column3 equal to 1 in the row, find the next matching row based on the criteria below. column3 in the matching row equal to 0 and column2 equal to column2 in the matching row test.csv - test data ... (7 Replies)
Discussion started by: chailee
7 Replies

14. UNIX for Beginners Questions & Answers

Egrep find word that occurs twice in a row

Hi there I am trying to figure out and understand what the syntax would be to egrep lines that have a word occur twice in a row. the two words obviously should have a space between them and also it has to be case sensitive which I believe grep is by deffault. the closest I have come is... grep... (7 Replies)
Discussion started by: spo_2138
7 Replies

15. Shell Programming and Scripting

Manipulation row order in file

Hello, I am trying to replace the position of each row by the next row. OS: Ubuntu 18.04, bionic I'd appreciate your help. input_file: -O fileA wget http://x.y.z./a -O fileB wget http://a.b.c./d -O fileC wget http://q.f.s/t .. .. .. -O fileZZ wget http://r.t.y/u I expect: (6 Replies)
Discussion started by: baris35
6 Replies