Hi Guys,
I want to use if conition for my script. Before I used it tried it with some small test scripts. But it was not succeeded. My script and screen output as follows,
Script:
echo 'Do you think Yes or No (y/n) : '
read ans
echo You input anser as $ans
ans1=y
if ( $ans == $ans1... (5 Replies)
hi, :)
pls consider the following if statement
if //g') ]
then
........
else
.......
when i execute the script i am getting the following error
'(' unexpected
I am not able to find the mistake.
could anybody tell where i did mistake.
cheers
RRK (13 Replies)
hi,
actully i need the belp for the below.
host_list=" Host1 host2 host3 host4 "
n=`hostname`
i need to put the condition like the below
if n is among the host mention in the host_list if
then
#some stugg
else
# some other stuff
fi (1 Reply)
Hi ,
I am trying the following simple script . But it is always giving 1 output. Dont know why
#!/bin/sh
find . -name "a.log"
if ; then
echo "1"
else
echo "0"
fi
Kindly advice. it is giving 1 output even when the a.log file is not there (26 Replies)
a=rhino
b=crocodil
c=testsc
if && "$c" = testsc ]
then
echo "Test #5 succeeds."
else
echo "Test #5 fails."
fi
i need to test or condition before check the output with AND condition. ur help is much appreciated... (11 Replies)
Hi all,
I have task to delete two different files from all file system. one is core file & other is old file.
i can delete core file but for old file i have to mv in different location.
i wrote a script but it is not working.
i have a two variables in this script first one is delcnt &... (6 Replies)
Hi,
I need to use if condition for search a file pattern on a particular location.
cd $file_Path
if ||
then
do this
else
do that
fi
Can someone help me with the if part, how i can put those conditions?
make sure format should be *.file* and *.file
file is a keyword which i... (5 Replies)
Hi i am writing a script where i am running , 5 scripts together in 1 script .
Now what i want is when these 5 scripts run completely , i should execute some other commands like i have compile the data etc.
I have have 5 echo statements at the end of all those scripts .
Like echo "1 is done" in... (1 Reply)
Hi All,
Seeking for your assistance on how to condition it correctly.
cat file1.txt
290,1663,43,888,0,0.00,86.91,0.00,26.98,0.00
290,1663,52,0,0,0.00,0.00,0.00,0.00,0.00
290,1663,52,888,0,0.00,34.60,0.00,9.00,0.00
1st scenario:
if the fourth column contains 888s and 0s it is by... (16 Replies)
Discussion started by: znesotomayor
16 Replies
LEARN ABOUT PHP
mssql_field_seek
MSSQL_FIELD_SEEK(3)MSSQL_FIELD_SEEK(3)mssql_field_seek - Seeks to the specified field offsetSYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset)
DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The field offset, starts at 0.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using mssql_field_seek(3) on the example for mssql_fetch_field(3)
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information, notice the
// field_offset parameter is not set. See
// the mssql_field_seek call below
$field = mssql_fetch_field($query);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
// Move the internal seek pointer to the next
// row in the result set
mssql_field_seek($query, $i + 1);
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO mssql_fetch_field(3).
PHP Documentation Group MSSQL_FIELD_SEEK(3)