Got stuck and need some help, This should be relatively simple but it’s been my bane for a few weeks now and am on the verg of giving up!
The problem is my user registration form for a social network I’m building all I want to do is replace a space with a + when the user enters their address into the database.
I have a page called activation.php that gets called into action when the user activates thie email address and I have this code block on the page…
$sql = mysql_query("UPDATE myMembers SET email_activated='1' WHERE id='$id' AND password='$hashpass'");
$sql = mysql_query("UPDATE myMembers SET firstname = REPLACE(firstname, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET lastname = REPLACE(lastname, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET housenumber = REPLACE(housenumber, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET addressone = REPLACE(addressone, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET addresstwo = REPLACE(addresstwo, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET county = REPLACE(county, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET city = REPLACE(city, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET country = REPLACE(country, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET postcode = REPLACE(postcode, ' ', '+'");
$sql = mysql_query("UPDATE myMembers SET phone = REPLACE(phone, ' ', '+'");
$sql_doublecheck = mysql_query("SELECT * FROM myMembers WHERE id='$id' AND password='$hashpass' AND email_activated='1'");
$doublecheck = mysql_num_rows($sql_doublecheck);
But of course it’s not updating the spaces with a +, Am I missing a trick somewhere or is this destined to fail!
Of course it goes without saying that I will thank you all in advance!
Regards
-P
None of the
REPLACE()calls have closing parentheses.