|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
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:
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:
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... Last edited by Breana : May 11th, 2008 at 08:13 AM. Reason: error in text... |
|
#2
|
|||
|
|||
|
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.
__________________
BookMooch.com : Give books away. Get books you want. |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > SQL Help! Insert after new user? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|