FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » Script problem (Scritpt doesn't update database in email validation)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Script problem [message #165239 is a reply to message #165238] Sat, 14 May 2011 13:07 Go to previous messageGo to previous message
anemic-cinema is currently offline  anemic-cinema   France
Messages: 4
Registered: May 2011
Location: Paris
Karma:
Junior Member
Hi thank you, I found a solution this morning. Smile

Could you give me your opinion about the script? How can i improve it?

<?php
$base = mysql_connect ('localhost', 'emailval', 'emailval');

mysql_select_db ('emailval', $base);

$queryString = ($_GET['code']);
	 
$result = mysql_query("SELECT * FROM membre") or die(mysql_error());

$row = mysql_fetch_array($result);

	if  ($row['activationkey'] == $queryString) {

	echo "Congratulations!" . $row["login"] . "";


 	$sql="UPDATE membre SET  status='activated' WHERE (id = $row[id])"; 
	$req = mysql_query($sql) or die('Erreur SQL !'.$sql.'<br />'.mysql_error());

	

	
  	}  else {

    	die('Error: ' . mysql_error());

	}
?>


Thank you very much!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Usenet group import
Next Topic: Choose PHP Framework Tips
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 00:50:19 GMT 2024

Total time taken to generate the page: 0.05117 seconds