SweetG
05-11-2011, 07:59 PM
I just started having an issue with a script that was working before and now its not.. and I'm not so certain its the script that's not working. In the script I execute two insert statements (that insert into two different tables), which previously worked.. Now only one gets inserted while the other does not. I've thoroughly looked over the code and there is nothing wrong with it. Is there anything in my database that could be causing this to happen. I'm just very upset and lost on this, because I really dont understand why one insert statement is working and the other is not.
//gather user information
$query=mysql_query("SELECT * FROM users WHERE id='$_SESSION[id]'");
while($info= mysql_fetch_assoc($query)){
$name = $info['name'];
$pic = $info['propic'];
$realm = $info['realm'];
}
if(empty($detail)){
header('Location:error9.php');
}
elseif(isset($detail)){
//this is the one not inserting
mysql_query("INSERT INTO classifieds VALUES ('','$_SESSION[id]','$name','$pic','$realm','$topic','$detail',now())");
//this one inserts
mysql_query("INSERT INTO activity VALUES ('$_SESSION[id]','$name','$txt',now())");
}
header('Location:edit.php');
I completely redid the form associated with the script and i completely redid the form associated with this script and made the appropriate changes in my code and redid the table in my database.
//gather user information
$query=mysql_query("SELECT * FROM users WHERE id='$_SESSION[id]'");
while($info= mysql_fetch_assoc($query)){
$name = $info['name'];
$pic = $info['propic'];
$realm = $info['realm'];
}
if(empty($detail)){
header('Location:error9.php');
}
elseif(isset($detail)){
//this is the one not inserting
mysql_query("INSERT INTO classifieds VALUES ('','$_SESSION[id]','$name','$pic','$realm','$topic','$detail',now())");
//this one inserts
mysql_query("INSERT INTO activity VALUES ('$_SESSION[id]','$name','$txt',now())");
}
header('Location:edit.php');
I completely redid the form associated with the script and i completely redid the form associated with this script and made the appropriate changes in my code and redid the table in my database.