Results 1 to 10 of 11
Thread: Star/Unstar a user.
Star/Unstar a user. 4 Mar 2009 @ 11.52
I have a little contact manager I am creating, and I have a function which I would like to set up.
Ok, so we have listed the number of customers, and I would like to be able star them, by clicking the icon, which then makes them available to a new list of just starred customers, which can later be unstarred.
Whats the best way to go about this?
I was thinking about adding a field to the users database, something like visible, and have either a 0 or 1 which will trigger 0 to be unstarred and 1 to be starred, would this be the best way to go about it?
If so, anyone know a tutorial of how to do this?
Thanks for your help
4 Mar 2009 @ 12.46
im new to php and mysql, but couldnt you just add a 'new' column which a 1 for each record you want to identify as new customer(or whatever the star is for) and then when you are displaying use:
SELECT * FROM table_name WHERE new_customer='1'
but like i said im new to this so i may be wrong
MySQL :: MySQL 5.0 Reference Manual :: 12.2.8 SELECT Syntax
4 Mar 2009 @ 12.55
This sounds like a good place to start, this is exactly what I needed, I myself am new at this, so trying to teach myself, but I knew this would be nice and simple to do, its just getting your head around what needs doing.
4 Mar 2009 @ 13.01
amen to that lol
4 Mar 2009 @ 13.02
This works beautifully thanks for that help, was nice and easy
4 Mar 2009 @ 13.12
Ok, this script works fine for listing all the starred customers, but how can I now, make them star myself, so once they click on the star icon it then adds to the db as 1, and if unclicked changes it to 0.
I am guessing this will need an if statement, but how would I go about this next?
4 Mar 2009 @ 13.27
have a checkbox/radiobutton in your form, and the insert the data into your database as you would with the rest, so if selected it returns the value '1', and get it to POST this along with the rest of your data
4 Mar 2009 @ 13.47
What about unclicking it? because it is actually not a form I will be using it in, I will be using it from when my results are all shown, and I want to be able to click the image, and it does it for me, instead of a radio buttom and a submit button.
5 Mar 2009 @ 18.44
i really dont know but i would presume the radio button would be an easier option as far as i can see, sorry
- Join Date
- Dec 2008
- Blog Entries
5 Mar 2009 @ 20.03
Hey craig, I might do a bit of a jQuery/PHP tutorial on this for learnitscreencasts, sounds like a challenge!Site: jackfranklin.co.uk Blog: ispeakwebstuff.co.uk Project: learnitscreencasts.co.uk
- By Xarzu in forum PHP, ASP & JavaReplies: 2Last Post: 7 Feb 2011, @ 07.28
- By 41ex in forum Coffee HouseReplies: 7Last Post: 18 May 2009, @ 16.51
- By saltedm8 in forum Imagery, Graphics & TypographyReplies: 7Last Post: 18 Apr 2009, @ 10.10