i kept .... just for understanding..I don't want that in my final output. I searched this forum for the solution. But didn't get the solution.
Any help will be much appreciated.
-Ravi
I want to access exact line in a file (sh script)
for example I have a variable input and I want to access input.th line in file. for example line 5 or 7. (2 Replies)
hello,
I have got the following problem that I am hoping someone can help with please.
1. I have got the following text file (below) , the columns data are
'Test Day', 'Board', 'Betting Number'.
TEXT FILE
============================================
1 3 02-01-27-28-29-30
0 1... (1 Reply)
Hello,
I have a problem which is giving me headache for days, can some please help. Please see code and text fiel below. Please see text in red for the problem I am facing
# Program gets an input x from user
while read line ; do
echo... (4 Replies)
I need to write value of variable $version at a particular line in a text file.
Line number is determined by another variable &line......I don't know how to do it in shell script ... (2 Replies)
Hi all,
I'm a little stuck with a data file I've been collecting data in. The file contains one field of data running continuously down the file and I can't work out how to format the data into three columns.
This is a mock up of the file: Each r# is a random number and varies in length, this... (3 Replies)
FOLKS ,
i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one.
thanks...
Venu (3 Replies)
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Hi All,
I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end.
Before:-
File Name:- File1.dat
102 121340560... (10 Replies)
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
I need to identify the exact text of San Antonio Generator Running in the output my script which lands to a text file. Once SED finds the specific text, I need it to insert one line above the matched text.
Here is what I have so far that isn't working all that well for me. Any help would be... (7 Replies)
Discussion started by: jbrass
7 Replies
LEARN ABOUT PHP
maxdb_insert_id
MAXDB_INSERT_ID(3) 1 MAXDB_INSERT_ID(3)maxdb_insert_id - Returns the auto generated id used in the last query
Procedural style
SYNOPSIS
mixed maxdb_insert_id (resource $link)
DESCRIPTION
Object oriented style
mixed$maxdb->insert_id ()
The maxdb_insert_id(3) function returns the ID generated by a query on a table with a column having the DEFAULT SERIAL attribute. If the
last query wasn't an INSERT or UPDATE statement or if the modified table does not have a column with the DEFAULT SERIAL attribute, this
function will return zero.
RETURN VALUES
The value of the DEFAULT SERIAL field that was updated by the previous query. Returns zero if there was no previous query on the connec-
tion or if the query did not update an DEFAULT_SERIAL value.
Note
If the number is greater than maximal int value, maxdb_insert_id(3) will return a string.
EXAMPLES
Example #1
Object oriented style
<?php
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
maxdb_report (MAXDB_REPORT_OFF);
$maxdb->query("DROP TABLE mycity");
maxdb_report (MAXDB_REPORT_ERROR);
$maxdb->query("CREATE TABLE mycity LIKE hotel.city");
$maxdb->query("ALTER TABLE mycity ADD id FIXED(11) DEFAULT SERIAL");
$query = "INSERT INTO mycity (zip,name,state) VALUES ('12203','Albany' ,'NY')";
$maxdb->query($query);
printf ("New Record has id %d.
", $maxdb->insert_id);
/* drop table */
$maxdb->query("DROP TABLE mycity");
/* close connection */
$maxdb->close();
?>
Example #2
Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
maxdb_report (MAXDB_REPORT_OFF);
maxdb_query($link,"DROP TABLE mycity");
maxdb_report (MAXDB_REPORT_ERROR);
maxdb_query($link, "CREATE TABLE mycity LIKE hotel.city");
maxdb_query($link, "ALTER TABLE mycity ADD id FIXED(11) DEFAULT SERIAL");
$query = "INSERT INTO mycity (zip,name,state) VALUES ('12203','Albany' ,'NY')";
maxdb_query($link, $query);
printf ("New Record has id %d.
", maxdb_insert_id($link));
/* drop table */
maxdb_query($link, "DROP TABLE mycity");
/* close connection */
maxdb_close($link);
?>
The above example will output something similar to:
New Record has id 1.
PHP Documentation Group MAXDB_INSERT_ID(3)