Jump to content

More SQL help


Faracus

Recommended Posts

This might seem like a silly question, but how do I make sure that a certain block of code only operates on a certain condition. I thought that I could put it in to the if function, but when I test it, I just get a blank screen.

<?php$con = mysql_connect("localhost","****","*****");if (!$con){die('Could not connect: ' . mysql_error());}mysql_select_db("ShackGuys Accounts", $con);$sql="UPDATE accounts SET sgmmorpg = 'n'WHERE uname = '" . mysql_real_escape_string($_POST['uname']) . "' AND password = '" . mysql_real_escape_string($_POST['pass']) . "'";$result = mysql_query($sql, $con);if (mysql_affected_rows($con)){  echo "Project Removed. <a href='index.html'>Click Here</a> to continue";$file = "$_POST[gname].ini";if (!unlink($file))  {  echo ("Error deleting $file");  }else  {  echo ("Character Deleted Sucessfuly");  }<br>$file = "$_POST[gname].html";if (!unlink($file))  {  echo ("Error deleting $file");  }else  {  echo ("Personal Page Deleted Sucessfuly");  }<br>$file = "$_POST[gname]";if (!unlink($file))  {  echo ("Error deleting $file");  }else  {  echo ("Congratulations You Have Opted-Out Sucessfuly");  }}else{  echo "Account not found. Please go back and check your information and try again.";}mysql_close($con);?>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...