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.


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


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.


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