thank you friends for help me to solve a part of my probs;
i got the solution....................
name age
-------------------
sam 22
john 32
peter 45
george 12 this is the DB table. table name is "TEST"
here is the code.
DB and PHP connection
-----------------------
<?php require('Connections/DB1.php'); ?>
<?php
mysql_select_db($database_DB1, DB1);
$query_Recordset1 = "SELECT * FROM test";
$Recordset1 = mysql_query($query_Recordset1, $DB1) or die(mysql_error());
$tot_Rec = mysql_num_rows($Recordset1);
?>
operation
---------
<?php
for($i=0;$i<$tot_Rec;$i++)
{
$row_Recordset1 = mysql_fetch_array($Recordset1);
$tot_Col = sizeof($row_Recordset1);
for ($j=0;$j<$tot_Col;$j++)
{
if($j=2){
echo $row_Recordset1[$j];
echo "<br>";
}
else { echo "bye <br>";}
}
}
?>
the output is:
sam
john
peter
george
22
32
45
12
but wht i want is not this.....
i want some thing different. here we can get data in order.
but i want to print randomly. for examle if we have M row N coll.
i want to display
(3rd row, 2nd coll) then (1st row, 4th coll)..............like this i want to acess data randamly. in diff palce of my out put page.
once again thank you friends for help me to solve a part of my probs;
please help me to solve this whole problem. thank you.



Reply With Quote

Bookmarks