I have the following array that is describing my table header:
$aColumns = array( 'time1.Time', 'time2.Time' , 'time1.id' , 'time1.Signal' , 'v.Name' , 'v.Lastname' );
I want to insert new values in the time1.id column.
When I process the following code I got my data shown in the first column which is time1.Time and I need it to be in column time1.id why is this happening?
Here is the code:
if ( mysql_num_rows( $rResult ) > 0 )
{
$aCols = array_keys( mysql_fetch_assoc( $rResult ) );
mysql_data_seek($rResult, 0);
$id= array_search( 'time1.id', $aCols );
$value= "NEW_VALUE";
while ( $aRow = mysql_fetch_row( $rResult ) )
{
$aRow[$id] = $value;
$aOutput['aaData'][] = $aRow;
}
}
Try using
idas the column name instead oftime1.id. Usually only the column names are returned as keys in the result array , even if you have specified the table names in the select fields.