http://www.perlmonks.org?node_id=778683


in reply to DBD::mysql fetchrow_array failed

$query_handle = $db->prepare($query); $query_handle->execute(); while(my @row = $query_handle->fetchrow_array()) { #ERROR HERE #~ Update only available data to 'Email Received' status if ($row[0] eq '1') { $query = "update radar_data set status=2 where dataid= +$row[1] and datatype=$data_type and hasid ='$HAS_break[5]';"; $query_handle = $db->prepare($query); $query_handle->execute(); } }

You are overwriting your 'select' $query_handle and replacing it with the 'Update' sql syntax being executed. in the loop. You need to not use $query_handle in both places.

Replies are listed 'Best First'.
Re^2: DBD::mysql fetchrow_array failed
by deadpickle (Pilgrim) on Jul 09, 2009 at 20:47 UTC
    Seems to have worked. Thanks a lot.