Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cubrid_num_fields(3) [php man page]

CUBRID_NUM_FIELDS(3)							 1						      CUBRID_NUM_FIELDS(3)

cubrid_num_fields - Return the number of columns in the result set

SYNOPSIS
int cubrid_num_fields (resource $result) DESCRIPTION
This function returns the number of columns in the result set, on success, or it returns FALSE on failure. PARAMETERS
o $result -$result comes from a call to cubrid_execute(3), cubrid_query(3) and cubrid_prepare(3) RETURN VALUES
Number of columns, on success. -1 if SQL sentence is not SELECT. FALSE when process is unsuccessful. EXAMPLES
Example #1 cubrid_num_fields(3) example <?php $conn = cubrid_connect("localhost", 33000, "demodb"); $req = cubrid_execute($conn, "SELECT * FROM code"); $row_num = cubrid_num_rows($req); $col_num = cubrid_num_fields($req); printf("Row Num: %d Column Num: %d ", $row_num, $col_num); cubrid_disconnect($conn); ?> The above example will output: Row Num: 6 Column Num: 2 PHP Documentation Group CUBRID_NUM_FIELDS(3)

Check Out this Related Man Page

CUBRID_RESULT(3)							 1							  CUBRID_RESULT(3)

cubrid_result - Return the value of a specific field in a specific row

SYNOPSIS
string cubrid_result (resource $result, int $row, [mixed $field]) DESCRIPTION
This function returns the value of a specific field in a specific row from a result set. PARAMETERS
o $result -$result comes from a call to cubrid_execute(3) o $row -The row number from the result that is being retrieved. Row numbers start at 0. o $field - The name or offset of the $field being retrieved. It can be the field's offset, the field's name, or the field's table dot field name (tablename.fieldname). If the column name has been aliased ('select foo as bar from...'), use the alias instead of the column name. If undefined, the first field is retrieved. RETURN VALUES
Value of a specific field, on success (NULL if value if null). FALSE on failure. EXAMPLES
Example #1 cubrid_result(3) example <?php $conn = cubrid_connect("localhost", 33000, "demodb"); $req = cubrid_execute($conn, "SELECT * FROM code"); $result = cubrid_result($req, 0); var_dump($result); $result = cubrid_result($req, 0, 1); var_dump($result); $result = cubrid_result($req, 5, "f_name"); var_dump($result); cubrid_close_request($req); cubrid_disconnect($conn); ?> The above example will output: string(1) "X" string(5) "Mixed" string(4) "Gold" PHP Documentation Group CUBRID_RESULT(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Move data from Column to Row

Hi all, I have a file with several columns of data, eg: A B C D 1 2 5 1 2 2 2 2 8 4 4 4 4 2 3 4 10 9 4 4 9 7 1 2 I need to get the values from, say, column B and place them into a string separated by a semicolon, eg: 2;2;4;2;9;7 Does... (4 Replies)
Discussion started by: danhodges99
4 Replies

2. UNIX for Dummies Questions & Answers

Column Alignment

I copied a word file to my Unix directory, How do I line up my columns to the file I copied over? (3 Replies)
Discussion started by: nikncha
3 Replies

3. UNIX for Dummies Questions & Answers

Row to Columns

Hi, I have a file like this. 1,1,1,0,0,0 1,1,2,1,0,0 1,1,3,0,0,0 1,1,4,0,0,0 ........... ........... 1,1,24,0,0,0 1,1,25,0,0,0 1,1,26,1,0,0 1,1,27,0,0,0 1,2,1,0,0,0 1,2,2,0,0,0 1,2,3,0,0,0 1,2,4,0,0,0 1,2,5,1,0,0 1,2,6,1,0,0 (4 Replies)
Discussion started by: vskr72
4 Replies

4. UNIX for Dummies Questions & Answers

meaning of columns in the result of executing 'ls -l'

Hello all, I do not understand the meaning of some columns in the result of executing 'ls -l'. For example, i got the following result by run 'ls -l' total 3531 -rw-r--r-- 1 root root 1351680 Oct 17 20:50 fileindex.rpm -rw-r--r-- 1 root root 16384 Oct 17 20:50 groupindex.rpm ... (5 Replies)
Discussion started by: cy163
5 Replies

5. Shell Programming and Scripting

If statement not working

I understand this question probably poses some child like stupidity, but I can't get this if statement to work for love or money. #!/bin/ksh echo "Input either 1 or 2" read Num if ; then echo "Message 1" if ; then echo "Message 2" else echo "false" fi $ ksh decisions Input either 1... (6 Replies)
Discussion started by: Hazmeister
6 Replies

6. UNIX for Dummies Questions & Answers

Adding a character

Hi, I cant seem to figure out how I add a character to an existing one. Heres my problem. So I have a line that looks like this: >56 584848392394958586858484849393 What I want to do is add Num in front of the 56. So basically I want to recognize the > and add Num in front of the... (6 Replies)
Discussion started by: kylle345
6 Replies

7. Shell Programming and Scripting

Comparing two columns

Hi, I want to compare two columns and find out missing entries e:g Column 1 Column 2 1 1 2 2 3 13 4 10 19 234 Results woud be 13. I will appreciate very much if anyone help me :). (12 Replies)
Discussion started by: krabu
12 Replies

8. Shell Programming and Scripting

How do I parse file with multiple different columns ?

I have a tool which generates results in a file at every minute and which has following columns. I need to create a script checks this file constantly and if Column ( QOM ) has value more then "30S" it should send an email. Can anybody help ? Thansk a lot. Time MxML MxQD G P OIC OUC MDC... (11 Replies)
Discussion started by: jayeshpatel
11 Replies

9. Shell Programming and Scripting

Output Row if Third Column is Larger

Hi, I am fairly new to Unix scripting. We are running Solaris 5.10. I have the following question: Assume a text file with one text column, followed by 2 integer columns. How would I generate a script or, preferably, a command that will output the rows in which the value of the third... (6 Replies)
Discussion started by: QZ1
6 Replies

10. Shell Programming and Scripting

Column reorganizing

Hallo Fiends, I have a .csv file which has 2 columns. 1st Column is the RATE and second is Destination. The 2 columns are separated by , Here is the example of how the file looks now: 2.35,38022|38038|38039|38044|38050|38057|3806|380700|38091|38093|38095|38096|38097|38098|38099 1.67,380... (6 Replies)
Discussion started by: kekanap
6 Replies

11. Shell Programming and Scripting

SQL Column Heading

Hi, I am selecting few columns from a table using select query in UNIX shell script ans sending the results as E-mail. But the column headings are not displayed fully. Instead it displays only a part of the heading. Please help as how to display it fully. Thanks in advance for your help. (7 Replies)
Discussion started by: pvelmuru
7 Replies

12. Shell Programming and Scripting

Replace First Column and First Row Data

HI Guys, I just want to replace data for First Column and Row Cell(1,1) Input :- Hello A B C X 1 2 3 Y 4 5 6 Z 7 8 9 Output:- Byee A B C X 1 2 3 Y 4 5 6 Z 7 8 9 From Hello to Byee .....And The Each file have Different String. (3 Replies)
Discussion started by: pareshkp
3 Replies

13. Shell Programming and Scripting

Filter Row Based On Max Column Value After Group BY

Hello Team, Need your expertise on following: Here is the set of data: C1|4|C1SP1|A1|C1BP1|T1 C1|4|C1SP2|A1|C1BP2|T2 C2|3|C2SP1|A2|C2BP1|T2 C3|3|C3SP1|A3|C3BP1|T2 C2|2|C2SP2|A2|C2BP2|T1 I need to filter above date base on following two steps: 1. Group them by column 1 and 4 2.... (12 Replies)
Discussion started by: angshuman
12 Replies

14. UNIX for Beginners Questions & Answers

Grep A Column Based On Column Name

I have a file with two columns separated by white space. Dog Cat fido sneaky dopey poptart ears whisker barky herd Trying to list the words under the column named Dog. Tried a few variations of awk but can't... (4 Replies)
Discussion started by: jimmyf
4 Replies

15. UNIX for Beginners Questions & Answers

Fetching 1st Column and Last n Columns

I am trying to fetch 1st column and last 10 columns.The code I am using is working fine but after using the code then output file becomes space delimited not tab delimited. awk 'BEGIN {OFS="\t"}{printf("%s\t",$1)}{for(i=NF-9; i<=NF; i++) {printf("%s\t",$i)};printf "\n" } ' inputfile ... (11 Replies)
Discussion started by: Nina2910
11 Replies