Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 20 Oct 2014, 01:22
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Real name: James
Problem with User Additions

Hey all! I am trying to design a system for our staff to add "points" to users for participating in events. I currently have the following code. The "Edit" and "Update" code works. I have tested it. What is not working is the main "add" part. A staff member should be able to type in multiple usernames separated by a semicolon ( then the correct number of points should be added. If anyone can help, let me know!

http://pastebin.com/Z2QxkkZU

Thanks again!
Reply With Quote
  #2  
Old 20 Oct 2014, 12:12
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
What happens when you try to add? The only thing I can see is that at the end of your update query sql you have:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and I believe it should just be $u.
Reply With Quote
  #3  
Old 20 Oct 2014, 22:12
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Real name: James
I have it working a bit, but now there is only one issue. Code below:

Basically, in the "UPDATE" portion, it works except when $upoints is 0, then the query is not executed and no confirmation message appears.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #4  
Old 20 Oct 2014, 22:25
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You have empty($_POST['points']), but that will be true if it's 0 (see the php page for empty()). I think you want to use !isset($_POST['points']) instead.
Reply With Quote
  #5  
Old 20 Oct 2014, 22:33
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Real name: James
Thank you based kh99. <3 I'm still a noob at this stuff. T.T
Reply With Quote
  #6  
Old 22 Oct 2014, 22:09
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Real name: James
Alright, so I have added another way to add points to make it easier for my members. Here is the code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The issue occurs in the "add via division" section. The message appears, saying that it has added the points but the queries are not actually being executed. Any suggestions would be helpful! This is coming along nicely for me!
Reply With Quote
  #7  
Old 22 Oct 2014, 22:16
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris
Not entirely sure but I believe iga_lastpointsdate = NOW should be iga_lastpointsdate = TIMENOW
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #8  
Old 22 Oct 2014, 22:21
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Real name: James
The NOW works. I've tested that. ^^ The newest addition was the "div" and "divadd" parts. I'm thinking there is something wonky when I attempt to pass the array of values from the multiple-selection box. All other methods of input work, so that's why I think it has to be that part of the query.

EDIT: I found the error. I needed to add square brackets to the names of the multi-select menus in order to have them pass the information as an array. Thanks for the help!

Last edited by KGodel; 22 Oct 2014 at 23:15. Reason: Solved
Reply With Quote
  #9  
Old 22 Oct 2014, 23:21
tbworld tbworld is offline
 
Join Date: Oct 2008
The correct function is being used: NOW() is a database function and does refer to the immediate timedate stamp, "timenow()" is the PHP version.

@KGodel, I am too busy today, but I will try to take a look at it tomorrow if no one has answered your question.

Last edited by tbworld; 22 Oct 2014 at 23:26.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 00:45.

Layout Options | Width: Wide Color: