Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mssql_data_seek(3) [php man page]

MSSQL_DATA_SEEK(3)														MSSQL_DATA_SEEK(3)

mssql_data_seek - Moves internal row pointer

SYNOPSIS
bool mssql_data_seek (resource $result_identifier, int $row_number) DESCRIPTION
mssql_data_seek(3) moves the internal row pointer of the MS SQL result associated with the specified result identifier to point to the specified row number, first row being number 0. The next call to mssql_fetch_row(3) would return that row. PARAMETERS
o $result_identifier - The result resource that is being evaluated. o $row_number - The desired row number of the new result pointer. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 mssql_data_seek(3) example <?php // Connect to MSSQL and select the database $link = mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi'); mssql_select_db('php', $link); // Select all people $result = mssql_query('SELECT [name], [age] FROM [persons] WHERE [age] >= 13'); if (!$result) { die('Query failed.'); } // Select every 4th student in the results for ($i = mssql_num_rows($result) - 1; $i % 4; $i++) { if (!mssql_data_seek($result, $i)) { continue; } // Fetch the row ... } // Free the query result mssql_free_result($result); ?> PHP Documentation Group MSSQL_DATA_SEEK(3)

Check Out this Related 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)
Man Page

14 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

Sending one email for every row as per sql result

I want to send email for every row comes out of following SQL statement thank you for your help. *****SQL STATEMENT****** Select SCUSER AS "USER IDS" , SCEUSER AS "LOCKED OUT" FROM SYS.7333.F98OWSEC; *******OUPUT COMES LIKE THIS AND ONE EMAIL COMES AS PER SCRIPT BELOW****** ******BUT... (4 Replies)
Discussion started by: s1a2m3
4 Replies

3. 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

4. Solaris

How to delete a row in a file

(8 Replies)
Discussion started by: natraj005
8 Replies

5. 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

6. 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

7. 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

8. 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

9. UNIX for Dummies Questions & Answers

Select 2 columns and transpose row by row

Hi, I have a tab-delimited file as follows: 1 1 2 2 3 3 4 4 a a b b c c d d 5 5 6 6 7 7 8 8 e e f f g g h h 9 9 10 10 11 11 12 12 i i j j k k l l 13 13 14 14 15 15 16 16 m m n n o o p p The output I need is: 1 1 a a 5 5 e e 9 9 i i 13... (5 Replies)
Discussion started by: mvaishnav
5 Replies

10. Shell Programming and Scripting

Select row from file and text

Hi all! I would like to solve a problem but I have no clue of how do it!I will be grateful if someone could help me! Briefly I have a big file like this: >ENSMUSG00000000204 | ENSMUST00000159637 GGCGAGGCTTACGCCATTTTACCTCAGCGAGCATTCATAAAGCTGCGAGCATTCATACAG >ENSMUSG00000000204 |... (3 Replies)
Discussion started by: giuliangiuseppe
3 Replies

11. Shell Programming and Scripting

Read row number from 1 file and print that row of second file

Hi. How can I read row number from one file and print that corresponding record present at that row in another file. eg file1 1 3 5 7 9 file2 11111 22222 33333 44444 55555 66666 77777 88888 99999 (3 Replies)
Discussion started by: Abhiraj Singh
3 Replies

12. 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

13. 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

14. 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