Page 1 of 1

[SOLVED] update domain name for user

Posted: Tue Jun 14, 2011 9:22 am
by nite4000
Hey everyone.

I am sure this is very simple but I have a license checker that when purchased that is for use with a domain only however i have to input http://www.domain.com and domain.com in the db.

My question is

How can I update the domains.. i can update the http://www.domain.com but i cant get it to update the domain.com without overwritting the other one.

Here is the code i have but if someone can help me out it would be nice.

Code: Select all



$domain = $_POST['new_domain'];
	
$domain_other = str_replace("www.","", $domain); 

//this one updates the http://www.domain.com for their account.
$query = mysql_query("UPDATE license SET domain ='$domain' WHERE email ='{$_SESSION['m_user']}' LIMIT 1")or die(mysql_error());

//this is where i tried to have it update the domain.com
$query = mysql_query("UPDATE license SET domain ='$domain_other' WHERE email ='{$_SESSION['m_user']}' LIMIT 1")or die(mysql_error());

if someone can help out thanks

Re: [SOLVED] update domain name for user

Posted: Wed Jun 15, 2011 4:09 am
by Peter Kelly
You are running the same query. What are the fields you need updating in the database? is it meant to be domain and domain_other?