Hello Everyone,
May some one help me with sql statement and php on how to select all the data from one column of table. I have tried with a code below but it is not working. I want to be selecting some data (all) data from one column table that meets some condition, then use selected data to update other table.
Php and sql are below;
Your help will be highly appreciated.

<?php

// selecting all the records where uploaded is YES
$query="SELECT * FROM payments where uploaded='YES' and BatchNumber ='$batchnumber'";
$result=mysql_query($query);

$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {
// Getting the Travel numbers that meets the conditions, so that records
//that that have same Travel number as selected can be updated using
// update statement below.
$zra=mysql_result($result,$i,"TravelNumber");

$i++;
}

$mysql_query ="UPDATE traveldetails SET BatchNumber='$batchnumber'where uploaded='NO'AND TravelNumber='$zra";
mysql_query($mysql_query) or die('Error, update query failed');




?>