
06-04-09, 04:07 AM
|
|
New Member
|
|
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi im trying to insert multiple records(which consists of many rows) into database..
But, only the first row is inserted meanwhile other rows do not..
can anyone please help me..
i will provide my coding here~
//this ia add.php
//this is insert.php
PHP Code:
<?php
$sql1= "insert into catbiborgdesc(bib_name) values('')"; insertData($sql1,$dbName); $sql2 = "SELECT MAX(bibID) AS max_value FROM catbiborgdesc"; $rkd = viewRecord($sql2,$dbName); $next_bib_id = $rkd->max_value; $sql3= "select tagID from cattagdesc WHERE tagID='".$_POST["tagID"]."'"; if($result = mysql_query($sql3,$db)) { if(mysql_num_rows($result)>0) { if ($_POST["tagID"]=='100'){ // INSERT INTO TABLE AUTHOR $sql4 ="insert into catauthortag(bibID,tagID,ind1,ind2,detail,name) values ($next_bib_id,'".$_POST["tagID"]."','".$_POST["ind1"]."','".$_POST["ind2"]."','".$_POST["detail"]."','".$_POST["name"]."')"; insertData($sql4,$dbName); }else if($_POST["tagID"]=='245'){ // INSERT INTO TABLE TITLE $sql4 ="insert into cattitletag(bibID,tagID,ind1,ind2,detail,name) values ($next_bib_id,".$_POST["tagID"].",'".$_POST["ind1"]."','".$_POST["ind2"]."','".$_POST["detail"]."','".$_POST["name"]."')"; insertData($sql4,$dbName); }else if($_POST["tagID"]=='020'){ // INSERT INTO TABLE ISBN $sql4 ="insert into catisbntag(bibID,tagID,ind1,ind2,detail,name) values ($next_bib_id,'".$_POST["tagID"]."','".$_POST["ind1"]."','".$_POST["ind2"]."','".$_POST["detail"]."','".$_POST["name"]."')"; insertData($sql4,$dbName); } } } ?>
Last edited by Nico; 06-04-09 at 09:47 AM.
Reason: Wrappers.
|