Jump to content

Deleting and inserting


Steve Angelis

Recommended Posts

<?php
$username=$_POST['username'];
$activate=$_POST['activate'];

require('../inc/config.php'); 
$linkid = @mysql_connect("$db_host", "$db_uname", "$db_pass");
mysql_select_db("$db_name", $linkid);

$result=mysql_query("SELECT activate FROM nxg_tempmbr WHERE username='$username'") or die("$query does not make any sence;<br>" . mysql_error());
if (mysql_num_rows($result)==0){ 
echo "No such user exists.";
}
else{
$result=mysql_fetch_array($result);
if ($activate == $result[0]){
$result2=mysql_query("SELECT * FROM nxg_tempmbr WHERE username='$username'") or die("$query does not make any sence;<br>" .    mysql_error());

$result2=mysql_fetch_array($result2);
$username1=$result2['username'];
$password=md5($result2['password']);
$empire_name=$result2['empire_name'];
$ruler_name=$result2['ruler_name'];
$email=$result2['email'];
$race_id=$result2['race_id'];
$description=$result2['description'];
$q = "INSERT INTO nxg_member (id, username, password, empire_name, ruler_name, email, race, description) values ('NULL', 		    '$username1', '$password', '$empire_name', '$ruler_name', '$email', '$race_id', '$description')";
    mysql_query($q) or die("$q does not make any sense;<br>" . mysql_error());
mysql_query("delete from nxg_tempmbr where $username='username'");

}
else{
	echo 'ERROR--Does '.$result[0].' = '.$activate.'?<br>';
}
}
?>

 

Now here is the problem.

 

 

mysql_query("delete from nxg_tempmbr where $username='username'");

 

 

I get this error which does not make sence.:

 

INSERT INTO nxg_member (id, username, password, empire_name, ruler_name, email, race, description) values ('NULL', 'steve1', '6f1ed002ab5595859014ebf0951522d9', 'empire', 'ruler', 'steveangelis@neraxia.com', '', 'yayayaya') does not make any sense;

Unknown column 'steve1' in 'where clause'

 

If I remove the delete line I get no error and it works.  Even though I get this error it still enters itsself into my database.

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.