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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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