---> mysql_result($result_category_id, 0, $i); I think it is compaigning about the '$i' of course we don't know what that is set to, so cannot help much. I would say it might not like it when '$i' is equal to 0... :-)
-Brad > Hello guys. > > The scenery: I've got an array with some values stored in it. I want to> > retrieve the id code each value is associated to. So I just do the follo> wing: > > for ($i=0; $i<count($form_category);$i++) > { > $query_get_id = "select cat_code from categories > where cat_name like '$form_category[$i]'"; > $result_category_id = mysql_query($query_get_id) or die(mysql_error()); > $form_category_id[$i] = mysql_result($result_category_id, 0, $i); //Thi> s > is line > 170 > echo $form_category[$i]." ".$form_category_id[$i]."<br>"; > } > > I'm getting the following in my browser (There are some comments I just > added): > > Arquitectura 2 //This is the correct category name and its ID > > Warning: Bad column offset specified > in /var/www/bva/new/common/scripts/admin_functions.php on line 170 > Caricatura //This is the correct category name but the ID is lost > > Warning: Bad column offset specified > in /var/www/bva/new/common/scripts/admin_functions.php on line 170 > Ciencias naturales //Same as before > > Any idea of what I'm doing wrong? > > ******************************************************* > Wilmar Pérez > Network Administrator > Library System > Tel: ++57(4)2105145 > University of Antioquia > Medellín - Colombia > 2002 > ******************************************************* > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php