Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-01-2007, 09:05 AM   #1
who
So Fucking Banned
 
Join Date: Aug 2003
Location: ICQ #23642053
Posts: 19,593
Really really EASY php/mysql - 1 line of code needed!

hi I just need someone to help me with one line of code in wordpress backend.

I have a new field in the 'wp_user' table of the wordpress database,

All I need to do is write some one line of code which will update that field with a value from $_POST

I am struggling now with this crap for a couple of hours... I feel like a retard and most likely am. But can anyone help me out?

Thanks.
who is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2007, 10:02 AM   #2
Pryda
Confirmed User
 
Industry Role:
Join Date: Dec 2005
Posts: 904
mysql_query("UPDATE [yourtablename] SET wp_user = '".mysql_real_escape_string(trim($_POST['username']))."'");

That will do the trick. It will fill every wp_user in the table with your POST value. If that is not what you want, you will have to specify a condition using WHERE.

For example:
mysql_query("UPDATE [yourtablename] SET wp_user = '".mysql_real_escape_string(trim($_POST['username']))."' WHERE wp_id = 1");

The function mysql_real_escape_string and trim are not necessary, but they add some extra flexibility and security.
__________________
Babepedia
Pryda is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.