delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

[
'user_username'
];
$signup_points
=
$new_user
->
user_info
[
'user_username'
]+
1000
;
$sql
=
"UPDATE se_users SET user_points='$signup_points' WHERE user_info='$puid'"
;
Am i doing it wrong? i am no master of sql lol  http://bbs.prog365.com/images/sites/honorhim.gif
It don't seem to give an error and after it saves the new user is there but the points is 0...


Ok i am trying to help my friend add a SQL insert command to his form but so far it just wont insert the value like i want it to so i wanted to post the original insert code and mine to see if anyone can see an error or a way to get it working!
Original code:
PHP Code:
// PROFILE FIELD INPUTS PROCESSED AND CHECKED FOR ERRORS ABOVE
  // IF THERE IS NO ERROR, ADD USER AND USER PROFILE AND CONTINUE TO STEP 3
if(
$is_error
==
0
) {
$new_user
->
user_create
(
$signup_email
,
$signup_username
,
$signup_password
,
$signup_timezone
,
$signup_lang
);
// INSERT ACTION
$actions
->
actions_add
(
$new_user
,
"signup"
, Array(
'[username]'
), Array(
$new_user
->
user_info
[
user_username
]));
My code, i created a table in se_users called user_points int(20) not null default 0, and i am trying to inset a valu of 1000 into it when a user signs up!
PHP Code:
$puid
=
$new_user
->
user_info
[
'user_username'
];
$signup_points
=
$new_user
->
user_info
[
'user_username'
]+
1000
;
$sql
=
"UPDATE se_users SET user_points='$signup_points' WHERE user_info='$puid'"
;
Am i doing it wrong? i am no master of sql lol  
It don't seem to give an error and after it saves the new user is there but the points is 0...

TOP

Welcome to DevShed.
This is clearly a PHP question as you've posted about 95\% PHP code and a very small (PHP dependent) SQL statement. Even if it were more SQL based this is still the wrong forum.
Without more insight as to how the class works and what the SQL statement is supposed to look like, I'm afraid we can't help you. Your class should have some sort of error handling built in or pass to an error handling object; if you would show the output of any errors from the SQL statement it would be helpful. Also helpful would be to verify what RDBMS is being used (MySQL?), the table structure, etc.
Requesting this be moved to the appropriate forum.

TOP

Thanks for the reply i did get it i was going in the wrong direction because his script uses Smarty so i re-did the code added the tag in the smarty/scripts section and now it works...
But i do have a question u might be able to answer, how can you affect the value of to colloums at once in one call code?
Like, $database->database_query("UPDATE se_users SET user_points='$status_points' WHERE user_id='".$user->user_info[user_id]."' LIMIT 1");
and have it load the next half of the code it keeps skipping over the send part witch is flagging the users to 0



[
'user_username'
];
$signup_points
=
$new_user
->
user_info
[
'user_username'
]+
1000
;
$sql
=
"UPDATE se_users SET user_points='$signup_points' WHERE user_info='$puid'"
;
Am i doing it wrong? i am no master of sql lol  http://bbs.prog365.com/images/sites/honorhim.gif
It don't seem to give an error and after it saves the new user is there but the points is 0...

TOP

Back Forum