FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Code help





RoughitforGreen247
<?php
$emailaddress = $_GET['email'];
mysql_connect("localhost", "roughitf_firsty", "coolcom") or die(mysql_error());
mysql_select_db("roughitf_first") or die(mysql_error());
$data = mysql_query("SELECT * FROM maillist WHERE email=$emailaddress) or die(mysql_error());
$info = mysql_fetch_array($data);
$name = $info['name'];
echo "We will be sorry to see you go, $name. Thank you for your interest in our content.";
mysql_query("DELETE FROM people WHERE email = $emailaddress");
echo "<br><br>You have been removed from our mailing list."
?>

I keep getting the error message:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/roughitf/domains/iequalsgamer.frih.net/public_html/test/removeuser.php on line 7

Anyone know whats wrong with it? I've tried everything I can think of.
Rhysige
Code:

<?php
$emailaddress = $_GET['email'];
mysql_connect("localhost", "roughitf_firsty", "coolcom") or die(mysql_error());
mysql_select_db("roughitf_first") or die(mysql_error());
$data = mysql_query("SELECT * FROM `maillist` WHERE `email`='$emailaddress'") or die(mysql_error());
$info = mysql_fetch_array($data);
$name = $info['name'];
echo 'We will be sorry to see you go, '. $name. .' Thank you for your interest in our content.';
mysql_query("DELETE FROM `people` WHERE `email`='$emailaddress'");
echo '<br><br>You have been removed from our mailing list.';
?>


That piece should now work, you had a few " in the wrong spots and didnt have ; on the last line... yeah anyway should work now.
RoughitforGreen247
Thanks for the help. I put your code in, and atleast it works without errors, but it doesnt remove the information from the database, which I can't understand.
Rhysige
mysql_query("DELETE FROM `people` WHERE `email`='$emailaddress'");

Must be incorrect in some way, the code itself is fine so check the table names etc.
Related topics
C++ code help
need some help - php switch code
BEGINNER NEEDS HELP WITH FINDING A HTML CODE!!!!!!!!!!!!!!!!
XHTML code help
Need help integrating html code into php
Technical problem... help with this line of code?
need help with this code
Whats the problem of my code? Help please
Need Help With This Code!
need html code tht will randomly change a pic/text plz help
Trojan-Clicker HTML IFrame.gv" removal from code help.
PHP and MySQL noob need help please!
bb code help - regex
.htaccess code help needed
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.