Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post

    Popup showing database and script progression

    I want to create a script that will send a mass email to all of the people in a specific table in my database. I have a mysql table that stores:

    Id--Username--Email

    along with other things, I want the script to look through the table and list all of the people, then start running through and sending emails one at a time. When it is done with each email, i want it to put a checkmark next to the row of the username and email that it sent. Then at the top center of the popup, have a percentage bar that updates for how much percent of the total emails it has sent. This project is mainly javascript, which is something that i can edit code for, but I am not completely profecient at it.

    So what I would like, is some help putting this together using php, and ajax. Can someone post a snippit or something that would help me out in doing this?

  • #2
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    *Bump*

  • #3
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    http://www.google.co.uk/search?hl=en...e+Search&meta=

    Take a look at one/some of those, try implementing them and come back with specific questions?

  • #4
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    i am not trying to upload a file, and i couldn't find a site that shows how to use ajax for general script progression.

  • #5
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    *bump*

  • #6
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts

  • #7
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    Okay, I know it sounds like I don't want to do any work, but I learn best from specific examples that show me my final goal. I have found many ajax websites now that have progress bars, but I need some sort of example that does what I want it to do, for me to be able to work with it, and make it bigger. So I am now going to specifically going to ask for someone to write me a basic code, so that I can start somewhere. Please don't see this as me not wanting to do anything on my own. Thank you.

  • #8
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    *bump* Can anyone help me out at all please.

  • #9
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Assuming that you know everything up to the point of showing the percentage... you'd need two queries to get the percentage.
    One would be to get the number of all the users that will get a mail.
    Code:
    SELECT COUNT(`primary_key`) AS `total_users` FROM `table`;
    # I assume every user is being mailed.
    The other one would be the number of users who already got the email.
    Code:
    SELECT COUNT(`primary_key`) AS `emailed_users` FROM `table` WHERE `was_emailed` = 1;
    The first query only needs to be run once and the second one evertime when you want to check for the percentage.
    You calculate the percentage simply by
    Code:
    $emailed_users / $total_users * 100
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #10
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    no, i can do the math. The math im fine at, what I am not good at is the general javascript to power this.

  • #11
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    Prototype has a nifty 'updater' function/class that means you can specify the id of an HTML element (a div for example) and a url, and then every X seconds (you specify this too) the url will be called (in the background) and whatever it returns gets put in the specified div.
    Documentation:
    http://www.sergiopereira.com/article...iodicalUpdater

  • #12
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by thesavior
    no, i can do the math. The math im fine at, what I am not good at is the general javascript to power this.
    The javascript forum is right at the top of the board.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •