11-17-2010
this is very funny situation
i tried the code on my laptop at home and its working fine
i dont know what goes wrong on the server with the code in office
tomorrow i will check it again in the office
for the while i have this code
################################
in deposit module
############
amtvalidation ()
{
len=`echo "$amt"|wc -c`
for((i=1;i<len;i++))
do
c=`echo "$amt"|cut -c$i`
case $c in
[0-9])continue;;
*)echo "invalid .enter:"
read amt
amtvalidation "$amt";;
esac
done
let r=amt%100
if [ $r -ne 0 ]
then
echo "enter amount in 100: "
read amt
amtvalidation "$amt"
fi
}
clear
echo "enter accno:"
read accno
echo "enter the amount:"
read amt
amtvalidation "$amt"
old=`grep -w "$accno" info|cut -d ":" -f7`
clear
sleep 1
echo "pre amt is $old "
let new=old+amt
sed "/$accno/s/$old/$new/" info > file
mv file info
echo
sleep 1
echo "added"
echo
n=`grep -w "$accno" info|cut -d ":" -f7`
sleep 1
echo "new amt is $n:"
echo
######################
in info file the red number is f7(field 7)
################
dha:jhjh:hgj@jhj.com:dha:8989898989:hjj:3800:123021
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
could any one provide me any new real time project idea in shell scripting
i am learning shell script and wants to do some real time development . (1 Reply)
Discussion started by: useless79
1 Replies
2. Programming
Hi All,
I am having problem with kerberos kadmin library in c++.
I am using red hat linux Enterprise Linux Server release 5 (Tikanga), and gcc c++ - 4.1.1-52.el4.i386.
When I make a c project (main.c) and use function from kadmin library such as
kadm5_init_krb5_context(&context); ... (2 Replies)
Discussion started by: amitp
2 Replies
3. Solaris
hi guys,
its been a while since my last visit here,
could not keep up the pace on this ever changing industry :)
i'd just doing my home research under vmware to make a solaris-based router-firewall using zones - doing a lot of reading about zones & review solaris zone functionality.
and... (4 Replies)
Discussion started by: stdout
4 Replies
4. Hardware
Dear all,
i am in last year of electronics department in engineering faculty
i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux "
i think about embedded unix for example or device drivers
please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies
5. UNIX and Linux Applications
Dear all,
i am in last year of electronics department in engineering faculty
i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux "
i think about embedded unix for example or device drivers
please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies
6. UNIX for Advanced & Expert Users
Dear all,
i am in last year of electronics department in engineering faculty
i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux "
i think about embedded unix for example or device drivers
please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies
7. Homework & Coursework Questions
Dear all,
i am in last year of electronics department in engineering faculty
i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux "
i think about embedded unix for example or device drivers
please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies
8. Solaris
Hi friends,
I am a Computer Science student, and about to do my final year project. I am a big lover of Solaris and SPARC RISC computers, and I want to work on those computers in future. I want to become a System Administrator/Security Administrator etc on the Solaris stuff. Could you please tell... (1 Reply)
Discussion started by: gabam
1 Replies
9. Open Source
Hello,
Please suggest or share any of your experience for the following requests:
Request:
1.
Creation of the local network.
The company will be in the field of IT.
10-15 persons. 10 will be physically in the office.
The local network should be secured and all the files and... (0 Replies)
Discussion started by: AQwert
0 Replies
LEARN ABOUT PHP
mssql_num_fields
MSSQL_NUM_FIELDS(3) MSSQL_NUM_FIELDS(3)
mssql_num_fields - Gets the number of fields in result
SYNOPSIS
int mssql_num_fields (resource $result)
DESCRIPTION
mssql_num_fields(3) returns the number of fields in a result set.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
RETURN VALUES
Returns the number of fields, as an integer.
EXAMPLES
Example #1
mssql_num_fields(3) example
<?php
// Connect to MSSQL and select the database
$link = mssql_connect('KALLESPCSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php', $link);
// Select some data from our database
$data = mssql_query('SELECT [name], [age] FROM [php].[dbo].[persons]');
// Construct a table
echo '<table border="1">';
$header = false;
// Iterate through returned results
while ($row = mssql_fetch_array($data)) {
// Build the table header
if (!$header) {
echo '<thead>';
echo '<tr>';
for ($i = 1; ($i + 1) <= mssql_num_fields($data); ++$i) {
echo '<td>' . ucfirst($row[$i]) . '</td>';
}
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$header = true;
}
// Build the row
echo '<tr>';
foreach($row as $value) {
echo '<td>' . $value . '</td>';
}
echo '</tr>';
}
// Close table
echo '</tbody>';
echo '</table>';
// Clean up
mssql_free_result($data);
mssql_close($link);
?>
SEE ALSO
mssql_query(3), mssql_fetch_field(3), mssql_num_rows(3).
PHP Documentation Group MSSQL_NUM_FIELDS(3)