mysql + php to make todo list

Discussion in 'Web Design & Coding' started by lieb39, Feb 15, 2003.

  1. lieb39

    lieb39 Apple lover, PC User

    Messages:
    526
    Location:
    Australia
    Hello.

    On my system I have mysql and php with apache installed, no problems. Works 100%.

    How would I make a webpage that gets infomation from a mysql database, and displays it. than at the bottem of the webpage it would have 2 input boxes, to add to the mysql document?

    1. What I would like to do is have a mysql database, and on a webpage (php?) it would have 2 columns. One would be "Done?" and the other would be "Task". This would be a To Do list. I would like to make the 2 columns displayed, but in the "Done?" column, instead of a Y or N i would like a checkmark or a empty box (when its not checkmarked), and you could click on the checkmark if it's done.

    2. Than at the bottem of the website I would like 2 input boxes, one being "Done?" and the other being "Task" you could fill these in, and it would add to the mysql document, and than reload the website so that new task is shown.

    Now, is this even remotely possible? If so if somewould could tell me how, than WOW! but if not if someone could just post a link to show basically how to do this. If (in #2) the checkmark thing isn't possible, than a Y/N is alright.

    Thank you very much,
     
  2. Khayman

    Khayman I'm sorry Hal... Political User Folding Team

    Messages:
    5,518
    Location:
    England
    Well it can be done and it is relatively easy (if you know php and html), i have several such things on my own site.

    A good place to look for some nice simple code is
    http://www.spoono.com/tutorials/php/
    where you can find how to add and update mysql databases and other things
     
  3. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Will this one do? :)


    Yes, I was bored. :)
     
  4. lieb39

    lieb39 Apple lover, PC User

    Messages:
    526
    Location:
    Australia
    YOU ARE GOD!

    Zedric,

    YOU ARE GOD! IT IS EXALTY WHAT I AM LOOKING FOR! THANK YOU SO MUCH! ALL HAIL ZEDRIC!

    Thanks SO much!
     
  5. lieb39

    lieb39 Apple lover, PC User

    Messages:
    526
    Location:
    Australia
    Problem...

    I just tried it out on my active desktop... -->

    When I check/uncheck or add a new task it opens a new window if the webpage is on active desktop. i plan to use this on my active desktop, how would i make it so it doesn't open a new window?

    Another thing, you forgot to add a delete button...

    maybe it would be better if you could check the boxes (beside the tasks) , than at the bottem of the page there would be two boxes, one saying "done" (that would trigger being done/ not being done) and another being "delete"

    Thanks
     
  6. lieb39

    lieb39 Apple lover, PC User

    Messages:
    526
    Location:
    Australia
    When you add a new item, it opens up in the same window. i fixed that, however when you check/uncheck an item it opens a new window.
    Fixed.

    once i've got everything working, i'll post the final script (by Zedric) on, so all you guys can download it.

    Update: Just need to get a delete button in there

    help?
     
  7. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
  8. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Working on the Delete button...

    I didn't think you wanted one since you didn't say so... :)

    Btw, did you try to remove the "Checkboc f*cks up" part? I wonder if it's my PHP that is acting up. I'm haveing problems with phpMyAdmin as well. Doubles everything in the queries. :(
     
  9. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    If you just installed php 4.3.0 it could be that.
     
  10. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Nope, 4.2.2 running on RedHat Linux with Apache 2.0.40.

    Here's the new script btw.
     
  11. lieb39

    lieb39 Apple lover, PC User

    Messages:
    526
    Location:
    Australia
    Here's the final (v4) version of Todo. Its a script that shows a todo list that can be placed on active desktop. Created by Zedric and edited by lieb39.

    This is the NTFS version.

    Let me know what you think of it.
     
  12. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    You shouldn't release a final full of bugs. ;)

    - Fixed a CSS-bug.
    - Cleaned up some code
    - Added helpful comments in inc.db.php
    - Added SQL file! (again)

    My PHP is really acting up! If I use ':s in the task they sometimes show up as \\' and sometimes as '. They change if I reload! *gaaaargh* :mad:

    Anyway, here is TODO v5 (final?)

    <edit>Aw crap, ":s don't work at all. Can you live without it?</edit>
     
  13. Alvy

    Alvy Guest

    I get

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in C:\Apps\Internet\Apache\htdocs\active\todo\index.php on line 61

    on top of the bar.
    Any idea why? =)
     
  14. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Hmm, I would guess you haven't set up the database correctly or the connection to it failed. Did you install the sql-file?
     
  15. Alvy

    Alvy Guest

    I have Apache, PHP and MySQL installed prior to using this script. Anything else I must do to setup the database to prevent

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in C:\Apps\Internet\Apache\htdocs
    \active\todo\index.php on line 61

    =) And how to do it too =P if possible
     
  16. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    - Get and install phpMyAdmin.
    - Create a database called todo.
    - Run an SQL query based on the .sql file in the zip file. Do this in phpMyAdmin.

    Then try running the todo list in a browser first.