Jump to content

binodkumars

Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Kolkata, India
  • Age
    22

binodkumars's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. For making things easier I am explaining the problem by giving an overview to the codes which I have used previously.. Step 1 Calculate the membership value : $mem_value = array(); for($i = 0 ; $i < $rows ; $i++ ) { $mem_value[] = round((1 - ( abs($fdata - $Age[$i]) / $average)),2); } STEP 2 Calculate the S.M. value $sm = array(); for($i = 0 ; $i < $rows ; $i++ ) { $sm[] = round(sqrt($mem_value[$i]),2); } STEP 3 Inserting the values present in $sm into the column "sm" present in the table "sm" Now I want to know that how should I export or Insert the value of $sm in the specific column present in the table "sm". ???
  2. Thanks @Lemmin for the quick reply, but after implementing your suggested code $q = 'INSERT INTO sm(SM) VALUES '; foreach ($sm as $value) $q .= '("'.$value.'"),'; $q = substr($q, 0, -1); print_r($q); mysql_query($q) or die(mysql_error()); I am getting an error " Duplicate entry '0' for key 1 ". How should I recover from this error ??
  3. I have an array ($sm[]) which stores several decimal numbers. Now I want to insert these data present in the array to a column "SM" present under empty table "sm". So anybody please suggest how should I do this by writing few lines of php code.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.