![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |