killervastu Posted November 10, 2011 Share Posted November 10, 2011 //enter into btree ---------------------------------------------- $sql_plevel='select nlevel from btree where uniqueid = '.$formjoinedunder; $abc = mysql_query($sql_plevel , $db) $result_plevel = mysql_fetch_assoc($abc) or die(mysql_error()); $plevel = $result_plevel['nlevel'] + 1; $insert_btree = 'INSERT INTO btree (uniqueid,nlevel,pside) VALUES ('.$reguniqueid.','.$plevel.','.$formposition.')'; mysql_query($insert_btree , $db) or die(mysql_error()); Can any one please tell me what is the problem in the above code it does not insert into the table btree. Quote Link to comment https://forums.phpfreaks.com/topic/250902-insertion-in-database-problem/ Share on other sites More sharing options...
killervastu Posted November 10, 2011 Author Share Posted November 10, 2011 $abc = mysql_query($sql_plevel , $db); ; was not added but it still dosen't work Quote Link to comment https://forums.phpfreaks.com/topic/250902-insertion-in-database-problem/#findComment-1287212 Share on other sites More sharing options...
ReeceSayer Posted November 10, 2011 Share Posted November 10, 2011 I'm still a learner too so this might not be right but: //enter into btree ---------------------------------------------- $sql_plevel='select nlevel from btree where uniqueid = '.$formjoinedunder; $abc = mysql_query($sql_plevel , $db) $result_plevel = mysql_fetch_assoc($abc) or die(mysql_error()); $plevel = $result_plevel['nlevel'] + 1; $insert_btree = 'INSERT INTO btree (uniqueid,nlevel,pside) VALUES ('$reguniqueid', '$plevel', '$formposition')'; mysql_query($insert_btree , $db) or die(mysql_error()); Not sure you needed the .$value. in the query? I've looked at some i've done before and they just have the values as they are above. Can always try it. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/250902-insertion-in-database-problem/#findComment-1287224 Share on other sites More sharing options...
killervastu Posted November 11, 2011 Author Share Posted November 11, 2011 Problem Is solved I don't Know how but its working good Quote Link to comment https://forums.phpfreaks.com/topic/250902-insertion-in-database-problem/#findComment-1287261 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.