[SOLVED] update domain name for user

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

[SOLVED] update domain name for user

Post 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
Peter Kelly
Forum Contributor
Posts: 143
Joined: Fri Jan 14, 2011 5:33 pm
Location: England
Contact:

Re: [SOLVED] update domain name for user

Post 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?
Post Reply