Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbase_add_record(3) [php man page]

DBASE_ADD_RECORD(3)							 1						       DBASE_ADD_RECORD(3)

dbase_add_record - Adds a record to a database

SYNOPSIS
bool dbase_add_record (int $dbase_identifier, array $record) DESCRIPTION
Adds the given data to the database. PARAMETERS
o $dbase_identifier - The database link identifier, returned by dbase_open(3) or dbase_create(3). o $record - An indexed array of data. The number of items must be equal to the number of fields in the database, otherwise dbase_add_record(3) will fail. Note If you're using dbase_get_record(3) return value for this parameter, remember to reset the key named deleted. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Inserting a record in a dBase database <?php // open in read-write mode $db = dbase_open('/tmp/test.dbf', 2); if ($db) { dbase_add_record($db, array( date('Ymd'), 'Maxim Topolov', '23', 'max@example.com', 'T')); dbase_close($db); } ?> SEE ALSO
dbase_delete_record(3), dbase_replace_record(3). PHP Documentation Group DBASE_ADD_RECORD(3)

Check Out this Related Man Page

DBASE_GET_RECORD_WITH_NAMES(3)						 1					    DBASE_GET_RECORD_WITH_NAMES(3)

dbase_get_record_with_names - Gets a record from a database as an associative array

SYNOPSIS
array dbase_get_record_with_names (int $dbase_identifier, int $record_number) DESCRIPTION
Gets a record from a dBase database as an associative array. PARAMETERS
o $dbase_identifier - The database link identifier, returned by dbase_open(3) or dbase_create(3). o $record_number - The index of the record. RETURN VALUES
An associative array with the record. This will also include a key named deleted which is set to 1 if the record has been marked for dele- tion (see dbase_delete_record(3)). Each field is converted to the appropriate PHP type, except: o Dates are left as strings. o Integers that would have caused an overflow (> 32 bits) are returned as strings. On error, dbase_get_record_with_names(3) will return FALSE. EXAMPLES
Example #1 Listing all the registered members in the database <?php // open in read-only mode $db = dbase_open('/tmp/test.dbf', 0); if ($db) { $record_numbers = dbase_numrecords($db); for ($i = 1; $i <= $record_numbers; $i++) { $row = dbase_get_record_with_names($db, $i); if ($row['ismember'] == 1) { echo "Member #$i: " . trim($row['name']) . " "; } } } ?> SEE ALSO
dbase_get_record(3). PHP Documentation Group DBASE_GET_RECORD_WITH_NAMES(3)
Man Page

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tr command

I have a record that contains a equal sign plus a linefeed right behind it in the middle of the record, and the end of the record contains a linefeef which I want to keep. I want to remove the equal sign plus linefeed but I am having no luck. I'm using the tr command. Any ideas. (3 Replies)
Discussion started by: Dan Savarino
3 Replies

2. UNIX for Dummies Questions & Answers

How to avoid historying my command

Dear all, Normally unix automatically record up to 500 the command lines whatever I put in. Does anyone knows how I can avoid this record, in another word, I dont want system remember what I typed in thanks (2 Replies)
Discussion started by: ting123
2 Replies

3. UNIX for Dummies Questions & Answers

Read file and remove max length

Hi all, I tried to write a shell to read huge file and eliminate max length record which is wrong generated record. But I get an error remove_sp.sh: line 27: syntax error near unexpected token `else' remove_sp.sh: line 27: ` else $LINE >> REJFILE' My shell is here: #!/bin/sh... (5 Replies)
Discussion started by: mr_bold
5 Replies

4. UNIX for Advanced & Expert Users

Inserting new record after lookup

I have a requirement: I got a perfect example in this forum and looks like it would be quite similar but I have an additional task to do. I would explain. I have a file x.csv client_id,client_nbr ABC,1250 CDE,1520 EFG,1000 PQR,1800 I have a file y.csv client_id,client_nbr ABC,1000... (0 Replies)
Discussion started by: RubinPat
0 Replies

5. UNIX for Dummies Questions & Answers

File Handling in UNIX

Hi all, I have a requirement here where I am dealing with a dynamic file. Each record in the file can contain anywhere between 1(min) to 42(max) Reject codes. For example I may have one record in the file having 3 reject codes and another record having 5 reject codes. The reject codes will be... (2 Replies)
Discussion started by: sujainarayan
2 Replies

6. Programming

Evaluated variables in PHP

I'm putting my club's membership database online. I have a Member table in the database with fields such as FirstName, LastName etc. I have a web form with matching input variables Member_FirstName, Member_LastName that's going to be used for inserting a new member into the database, so I'll be... (2 Replies)
Discussion started by: JerryHone
2 Replies

7. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies