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 following:

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); //This
                                                                    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

Reply via email to