sending array to sql query
Posted: Fri Mar 25, 2005 8:54 am
I want to append multiple selections from a multi select to a database field. The problem is that only the first selection gets appended to the db. The problem is that the array($findkwresult[$no]
only gets set to the first value, any subsquent iterations dont have any values loaded into them:
feyd | Please review how to post code using
Code: Select all
while (OCIFetchInto ($s1, $row, OCI_ASSOC)) {
$findkwresult = array();
$findkwresult[] = $row['KEYWORDID'];
}
$selecttype = $_POST['selecttype'];
if(isset($_POST['keywordparam'])){
for($no=0;$no<count($_POST['keywordparam']);$no++){
$keywordelement = $_POST['keywordparam'][$no];
echo 'findkwresult' . $findkwresult[$no];
echo 'keywordelement' . $keywordelement;
//$updateq = "update k3gisdcp.keywords set keyword = keyword || '" . $keywordelement . "' where keyword_id = '" . $findkwresult ."'" ;
$updateq = "update k3gisdcp.keywords set keyword = keyword || 'keyword: " . $keywordelement . "' where keyword_id = '{$findkwresult[$no]}'";
$s2 = OCIParse($c1, $updateq) or die("update error : $updateq");
OCIExecute($s2);
$committed2 = ocicommit($c1);feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]