Hi,
Let's say I have the following array stored in a $_SESSION variable:
Array ( [0] => 1 [Abstract_ID] => 1 [1] => PROTEOMIC MAPPING OF DYNAMIC PROTEIN-PROTEIN INTERACTIONS IN MAMMALIAN CELLS [Title] => PROTEOMIC MAPPING OF DYNAMIC PROTEIN-PROTEIN INTERACTIONS IN MAMMALIAN CELLS [2] => 1 [Topic_ID] => 1 [3] => [Other_Topic] => [4] => 1 [Presentation_Type_ID] => 1 [5] => 7 [AV_ID] => 7 [6] => 60 [AV_Length] => 60 [7] => 1 [Language_ID] => 1 [8] => 22/1/2006 15:00 PM [Notes] => 22/1/2006 15:00 PM [9] => 1 [Doc_ID] => 1 [10] => 2006-01-16 [Date_Received] => 2006-01-16 [11] => 17 [Author_ID] => 17 [12] => Barrios-Rodiles [Last_Name] => Barrios-Rodiles [13] => Mario [First_Name] => Mario )
Here is my MYSQL table definition where I want to post this array to:
CREATE TABLE Abstract_Information (
Abstract_ID int(11) NOT NULL auto_increment,
Title varchar(255) NOT NULL default '',
Topic_ID int(11) NOT NULL default '0',
Other_Topic varchar(100) NOT NULL default '',
Presentation_Type_ID int(11) NOT NULL default '0',
AV_ID int(11) NOT NULL default '1',
AV_Length int(11) NOT NULL default '0',
Date_Received date NOT NULL default '0000-00-00',
Author_ID int(11) NOT NULL default '0',
Doc_ID int(11) NOT NULL default '0',
Language_ID int(11) NOT NULL default '1',
Notes text NOT NULL,
IP varchar(255) NOT NULL default '',
PRIMARY KEY (Abstract_ID),
UNIQUE KEY ID (Abstract_ID)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=0 AUTO_INCREMENT=5 ;
Now here is my piece of coding:
function cancel_changes_abstract()
{
$conn = db_connect();
$original_data_main = $_SESSION['original_data_main'];
foreach ($original_data_main as $data)
{
}
return true;
}
I wanna know how I could do my update query in my foreach loop? Can anyone give me a tip please? Thanks!