Jump to content

kelliethile

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by kelliethile

  1. thanks phpchamps!
  2. I have been following tutorials from learningnerd.com, to do this to do list management program. I'm struck with delete function. Can someone proof-read my codes and see if I'm doing something wrong? Everything works okay, like adding elements to list, but to delete it off list is my problem. Also, here's the tut url: http://www.learningnerd.com/phpmysql-day-4 <html> <head> <title>Add to list</title> </head> <body> <form method="post" action="try.php"> <label for="item">Add item to list: </label> <input type="text" name="item" id="item" size="30"> <br /> <label for="tag">Tag it: </label> <input type="text" name="tag" id="tag" size="15"> <br /> <input type="submit" value="Add to list" /> </form> <?php // Connecting, selecting database $link = mysql_connect('localhost', 'root', 'whatever') or die('Could not connect: ' . mysql_error()); echo 'Connected successfully'; mysql_select_db('try_db') or die('Could not select database'); // Inserting data if (isset($_POST['item'])) { $item = mysql_real_escape_string($_POST['item']); $tag = mysql_real_escape_string($_POST['tag']); // Performing SQL query $query = "INSERT INTO try_table (item, tag) VALUES ('$item', '$tag')"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); } ?> <?php if(isset($_POST['done'])) { $done = implode(', ', $_POST['done']); $deletequery = "DELETE FROM try_table WHERE id IN ($done)"; $resultdelete = mysql_query($deletequery) or die(mysql_error()); } ?> <h2>Things To Do</h2> <?php // Selecting the data $resultselect = mysql_query('SELECT * FROM try_table'); // Fetching and displaying data while($row = mysql_fetch_array($resultselect)) { ?> <input type="checkbox" name="done[]" id="<?php echo $row['id'] ?>" value ="<?php echo $row['id'] ?>" /> <label for="<?php echo $row['id'] ?>"> <?php echo $row['item'] . ' - tagged ' . $row['tag'];?> </label> <br /> <?php } ?> <input type="Submit" value = "Mark Items Complete" /> </form> </body> </html> please help
  3. hey (: i signed up and tested it out. really cool effort. everything works like it should. the design is a bit simple. the color scheme.... is sort of too bright to the eyes. but overall, you've done a great job!
  4. hello (: i'm a newbie too so i can't help but welcome.
  5. Hello all. I'm Kellie. I'm currently in the process of doing a Junior Project - it's a To-Do list management tool using PHP/MySQL. My advisor thinks it is not sophisticate at all when compared to doing an Iphone App., but you gotta start from somewhere, you know? So yes, I'm the biggest newbie when it comes to PHP haha. I got the list to work, still working on the deleting function! I think when I'm done, I will post it up here. Besides being super anxious to learn PHP, I have other hobbies like going to the movies (I hate hate chick flicks) and cook new recipes. I also enjoy being a broke college student. Anyone know a good site to learn PHP REALLY FAST? OR a good PHP book? I've read like 2 so far, with code examples. Thanks guys! CYA Tell me a little about yourself.
  6. Hi guys, I'm doing a To-Do-List management kind of project for school. I'm a newbie at PHP - programming in general. I was wondering, everytime I refreshes/F5 the page, the last item would be added automatically. How to change that? Here's my code (just try typing in an item, and refreshing it, you'll see what I mean) Please help, thanks (:
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.