>$_POST['category_id'];

What do you think this does?  Cuz it don't really "do" anything...

>  $numcat = count($category);
>          if ($numcat>1){
>          $category_id=implode(",",$category);
>          } elseif ($numcat==1){
>          $category_id=$category;
>  }

You have an array of '$category' that you need to insert into cat_survey. 
Whether you have 1 or 40 or 0 items in it, it's an array.

Actually, if they didn't pick anything, the variable won't even exist, so it
won't be an array.  And your count($category) will probably issue a Warning
message...

You need to do an INSERT for *every* category they chose:

while (isset($category) && $category_id = each($category)){

    >   $cat=mysql_query("insert into cat_survey
    >(pfsurvey_id,
    >   category_id) values
    >('$pfsurvey_id','$category_id')",$dbi);
    >    if (!$cat) {
    >    print "<p>Couldn't insert your record:
    >".mysql_error()."</p>\n";
    >    } 

}

>    print "<p>Loaded your data
>correctly.</p>\n";

This is still going to prit out, even if something went wrong.

Bad Human Interface.

You'll be giving contradictory statements one after the other.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to