brown2005 Posted September 15, 2009 Share Posted September 15, 2009 $get_emails = mysql_query("SELECT * FROM emails"); while($row = mysql_fetch_assoc($get_emails)) { $curr_email = $row['emails_email']; $curr_id = $row['emails_id']; $email = strtolower($curr_email); $email = rtrim($email); $email = ltrim($email); $email = mysql_escape_string($email); $del = mysql_query("UPDATE emails SET emails_email=$email WHERE emails.emails_id=$curr_id LIMIT 1"); echo "$email added to database<br>"; } hi i have the above code to take emails from my database and string them to lower and remove any white space left on the left or right of the entry, but it is not working. any help please Quote Link to comment https://forums.phpfreaks.com/topic/174372-editing-multiple-emails/ Share on other sites More sharing options...
mikesta707 Posted September 15, 2009 Share Posted September 15, 2009 perhaps you meant emails.email='$email' in any case you have to wrap varchars with single quotes Quote Link to comment https://forums.phpfreaks.com/topic/174372-editing-multiple-emails/#findComment-919166 Share on other sites More sharing options...
brown2005 Posted September 15, 2009 Author Share Posted September 15, 2009 lmao. my god im a plonker. cant believe i missed that. thanks Quote Link to comment https://forums.phpfreaks.com/topic/174372-editing-multiple-emails/#findComment-919171 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.