Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ibase_fetch_assoc(3) [php man page]

IBASE_FETCH_ASSOC(3)							 1						      IBASE_FETCH_ASSOC(3)

ibase_fetch_assoc - Fetch a result row from a query as an associative array

SYNOPSIS
array ibase_fetch_assoc (resource $result, [int $fetch_flag]) DESCRIPTION
Fetch a result row from a query as an associative array. ibase_fetch_assoc(3) fetches one row of data from the $result. If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using ibase_fetch_row(3) or use alias names in your query. PARAMETERS
o $result - The result handle. o $fetch_flag -$fetch_flag is a combination of the constants IBASE_TEXT and IBASE_UNIXTIME ORed together. Passing IBASE_TEXT will cause this function to return BLOB contents instead of BLOB ids. Passing IBASE_UNIXTIME will cause this function to return date/time values as Unix timestamps instead of as formatted strings. RETURN VALUES
Returns an associative array that corresponds to the fetched row. Subsequent calls will return the next row in the result set, or FALSE if there are no more rows. SEE ALSO
ibase_fetch_row(3), ibase_fetch_object(3). PHP Documentation Group IBASE_FETCH_ASSOC(3)

Check Out this Related Man Page

FBSQL_FETCH_ASSOC(3)							 1						      FBSQL_FETCH_ASSOC(3)

fbsql_fetch_assoc - Fetch a result row as an associative array

SYNOPSIS
array fbsql_fetch_assoc (resource $result) DESCRIPTION
Calling fbsql_fetch_assoc(3) is equivalent to calling fbsql_fetch_array(3) with FBSQL_ASSOC as second parameter. It only returns an asso- ciative array. This is the way fbsql_fetch_array(3) originally worked. If you need the numeric indices as well as the associative, use fbsql_fetch_array(3). An important thing to note is that using fbsql_fetch_assoc(3) is NOT significantly slower than using fbsql_fetch_row(3), while it provides a significant added value. PARAMETERS
o $ result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3). RETURN VALUES
Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows. If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you must use fbsql_fetch_array(3) and have it return the numeric indices as well. EXAMPLES
Example #1 fbsql_fetch_assoc(3) example <?php fbsql_connect($host, $user, $password); $result = fbsql_db_query("database", "select * from table"); while ($row = fbsql_fetch_assoc($result)) { echo $row["user_id"]; echo $row["fullname"]; } fbsql_free_result($result); ?> SEE ALSO
fbsql_fetch_row(3), fbsql_fetch_array(3), fbsql_fetch_object(3). PHP Documentation Group FBSQL_FETCH_ASSOC(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the column for a row in a text file and adding another row

Hi, I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value . For Eg . if the input file has a row : abc xyz lmn 89 lm nk o p I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies

2. Shell Programming and Scripting

unix

Hi friends, I have on data file containing 3 coloums........... like this. **** ***** ***** *** ***** ***** *** ***** ***** 12.36 13,27 22.16 **** ***** ***** **** ***** ***** **** ***** ***** **** ***** ***** 12.35 32.46 34.56 now from... (9 Replies)
Discussion started by: rajan_ka1
9 Replies

3. Shell Programming and Scripting

Print row if value in column 1 is the first occurence

Hi All, I would like to have a script which is able to perform the below. Print the whole row if column1 which is "0001" for the below example is the first occurrence. Subsequent "0001" occurrence will not be printed out and so on. Can any expert help ? Input: 0001 k= 40 0001 k= 2... (7 Replies)
Discussion started by: Raynon
7 Replies

4. Shell Programming and Scripting

How to format output

Dear all, I have written a program which access database and displays the values returned by the query . There are 10 columns to be displayed in one row. But am ending with 5 lines displayed on 1st line and the next 5 in the 2nd line. Ex : 21608 10-20-2007 148 Al's Appliance... (7 Replies)
Discussion started by: uday542
7 Replies

5. Shell Programming and Scripting

substracting common row names from two files

Hi, I have two files with with similar row names. For the names that match, I want to substract the values from each column. eg (files are tab separeted). FILE1: hhh 2 4 5 KKL 2 3 2 LLP 2 1 2 FILE2: hhh 3 1 1 KKL 2 1 1 UUI 1 1 1 (10 Replies)
Discussion started by: kylle345
10 Replies

6. Shell Programming and Scripting

Passing unix variable to oracle parameters

Please help me how to pass some unix vairable to oracle. I have used below , but not displaying passed (inval) value. calling() { sqlplus -s $1/$2@$3 <<EOF begin exec call_sql($4); end; exit EOF } calling user pwd inst value1... (17 Replies)
Discussion started by: Jairaj
17 Replies

7. Programming

Populating Associate Arrays in PHP

I'm not very good at associative arrays; and working on this PHP code has got me a bit stumped. My goal is to populate a (multidimensional) associative array in a PHP while look after a MySQL query. The code fragment looks like this: while($campaign_row = mysql_fetch_array($campaigninfo)) { ... (9 Replies)
Discussion started by: Neo
9 Replies

8. Shell Programming and Scripting

converting column to row

Hi everyone.. I have a list of values in a file... 1.2345e-1 2.282828e+ 3.2341e-1 1.1223445e-1 I am interested in converting this column to a row.. 1.2345e-1 2.282828e+ 3.2341e-1 1.1223445e-1 can anyone pls help?? I am a liunx newbie.. Thanks.. (7 Replies)
Discussion started by: kjha
7 Replies

9. Shell Programming and Scripting

Passing value of variable to a query within shell script

I have a script in which i connect to database to run a query and get the result of the query to a temp file. This works fine , now what i want is there is flat file which contains the value to be used in the query. I want to read this file line by line and then run the query for each value in that... (7 Replies)
Discussion started by: gpk_newbie
7 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Uneven column to row conversion

Hi Unix Forum, I have a relatively easy question i suppose for which, however, until now i could not find a solution. I am working with a program that will give me an output file similar to the following: A 1 2 3 4 B 1 2 3 4 C 1 (9 Replies)
Discussion started by: Leander
9 Replies

11. Shell Programming and Scripting

Replace values

Gents, Please can you help me with this. When column 49 == 2 Need to do the following changes; Change previous row field (substr$0,45,4)-1 Change previous row field (substr$0,72,5)+2 Change actual row field (substr$0,40,4)+1 Change actual row field (substr$0,49,1)-1 Change actual... (6 Replies)
Discussion started by: jiam912
6 Replies

12. Shell Programming and Scripting

To extract query from a text file.

Hi, I've a txt file with the following contents: variable = "select name, emp_id, org_name " variable = variable + " from table_name where " variable = variable + " condition_1 = ABC and " variable = variable + " condition_2 = DEF " varaible = variable + " order by other condition " ... (7 Replies)
Discussion started by: arjun_arippa
7 Replies

13. Shell Programming and Scripting

Fill column from previous row

Hi, I have the following content in file ABBR DESC COL3 COL4 COL5 COL6 AAA text desc aaa text text text text text text text text text text text text BBB text desc bbb text text text text text text text text CCC ... (10 Replies)
Discussion started by: bobbygsk
10 Replies

14. Shell Programming and Scripting

Count number of unique values in each column of array

What is an efficient way of counting the number of unique values in a 400 column by 1000 row array and outputting the counts per column, assuming the unique values in the array are: A, B, C, D In other words the output should look like: Value COL1 COL2 COL3 A 50 51 52... (16 Replies)
Discussion started by: Geneanalyst
16 Replies

15. Shell Programming and Scripting

How do I compare one line to the next.?

Q.). How do I take data in columns format and check the second column row to see if the data in the next row but in the second column is the same or not. If it is the same I want to print the full row out and then go to the next row and then do the same thing again but if the second column of the... (7 Replies)
Discussion started by: tron12
7 Replies