Jump to content

Insertion In database problem


killervastu

Recommended Posts

	//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.

Link to comment
https://forums.phpfreaks.com/topic/250902-insertion-in-database-problem/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.