Jump to content

sylunt1

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.brew-monkey.com

Profile Information

  • Gender
    Not Telling

sylunt1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. there is a row called task_complete or something of that nature... it defaults to 0 (not done) when they user puts a check in the box next to the tasks then it will update the row with a 1. What I am thinking is what laffin wrote - but I dont know how to pass all the variables like that - if they check # 1, 6, 47 how do I pass task_id=1, task_id=6 and task_id=47 from the form to the processing page? I think I am to the point where I confused myself as to wtf is going on
  2. Then on the page where the processing happens - how do I go about setting that part up to grab it?
  3. Here is how I list out the tasks... if ($tasks_id != $previous_tasks_id){ print '<table width="90%" cellspacing="3" cellpadding="3" border="0"><tr><td width="30%" height="1">' . $tasks_id . '&nbsp- ' . $tasks_task . '</td><td halign="left" width="30%" height="1"><INPUT TYPE=CHECKBOX NAME="' . $tasks_id . '"" VALUE="1""> complete</td></tr></table>'; $previous_tasks_id = $tasks_id ; } Will this need to be modified as well?
  4. I have a form that prints out a list of tasks with a checkbox that the user marks when it is complete. Basically its like this: task 1 task desctiption []done task 2 task desctiption []done ... task 100 task desctiption []done Each task has a unique task_id but I am confused how to enter this in the db. I want to be able to take the task_ids that have the check (value of 1) and update the db with this. Example Tasks 1, 5, 12,and 17 have a check so where task_id=1 and task_id=5 (etc...) update field to a 1. I am just not sure how to get here... Thanks.
  5. it isnt echoing anything out - once I put the date modification stuff in there it wont echo anything else except an incorrect modified date. If the start is 01/01/2008 it echos 01/21/2008 - thats it. I have put in markers before and after the code and those get echoed, but all the other variables go away...
  6. p2grace - yes i replaced my lines with yours... no go... obsidian - originally mine was using " and not ' - still same issue. I tried the 2nd example and still nothin... It is really perplexing...
  7. That just prints out -- nothing else....
  8. Hello: I am having issues with the below script. It is not computing the date correctly and none of the other variables are getting passed to the db. The object is to take tse_start (entered as mm/dd/yyyy) and add 28 days to it - this new date is to be entered as tse_estlive. Any help is appreciated. <?PHP $tse_start = $_POST['tse_start']; $tse_id = $_POST['tse_id']; $tse_name = $_POST['tse_name']; $tse_mentorname = $_POST['tse_mentorname']; $tse_mgr = $_POST['tse_mgr']; $tse_grpid = $_POST['tse_grpid']; $tse_start = $_POST['tse_start']; $tse_level = $_POST['tse_level']; $tse_weekorder = $_POST['tse_weekorder']; $tse_bootdone = $_POST['tse_bootdone']; $tse_start_db = date('Y-m-d', strtotime($tse_start)); $tse_est_live_db = date('Y-m-d', strtotime('$tse_start_db +28 days')); $db = mysql_connect("$server", "$user", "$password"); mysql_select_db('mentor', $db) or die ('Cannot connect to $db_Database : ' . mysql_error()); echo "$tse_start_db"; echo "$tse_name $tse_mentorname $tse_mgr $tse_grpid $tse_start_db $tse_estlive_db $tse_level $tse_weekorder $tse_bootdone"; $sql = "INSERT INTO tse (tse_name, tse_mentorname, tse_mgr, tse_grpid, tse_start, tse_estlive, tse_level, tse_weekorder, tse_bootdone) VALUES ('$tse_name', '$tse_mentorname', '$tse_mgr', '$tse_grpid', '$tse_start', '$tse_est_live_db', '$tse_level', '$tse_weekorder', '$tse_bootdone')"; $sql_result = mysql_query($sql,$db) or die ('Could not insert data'); echo('Data inserted successfully.'); mysql_close($db);
  9. Hello... Here is what I am trying to do.... I want to take $tse_start and add 28 days to it and have that be $tse_estlive which will then be inserted in to mysql. $tse_start is a date field that is being posted from a form on a previous page. I am thinking something like this... but as it is - no luck $tse_estlive = mktime(0, 0, 0, $tse_start("m") , $tse_start("d")+28, $tse_start("Y")); Any help is appreciated.
  10. <FORM ACTION="tsecomplete.php"> <blockquote> <?php $db = mysql_connect("$server", "$user", "$password"); mysql_select_db('mentor', $db) or die ('Cannot connect to $db_Database : ' . mysql_error()); $id = $_GET['id']; $result = mysql_query ("SELECT tse.tse_id, tse.tse_name, tasks.tasks_id, tasks.tasks_task, tasks.tasks_week, tasks.tasks_day, tasks.tasks_order FROM tse, tasks WHERE tse.tse_id = $id ORDER BY tasks.tasks_week, tasks.tasks_day, tasks.tasks_order") or die(mysql_error()); while($row = mysql_fetch_array($result)) { $tasksans_id = $row['tasksans_id']; $tasks_tsedone = $row['tasks_tsedone']; $tasks_date = $row['tasks_date']; $tasks_mdone = $row['tasks_mdone']; $tasks_id = $row['tasks_id']; $tasks_task = $row['tasks_task']; $tasks_week = $row['tasks_week']; $tasks_day = $row['tasks_day']; $tasks_order = $row['tasks_order']; $tasks_add1 = $row['tasks_add1']; $tasks_add2 = $row['tasks_add2']; $tasks_add3 = $row['tasks_add3']; $tasks_add4 = $row['tasks_add4']; $tse_id = $row['tse_id']; $tse_name = $row['tse_name']; $tse_weekorder = $row['tse_weekorder']; $weeks_id = $row['weeks_id']; $weeks_1 = $row['weeks_1']; $weeks_2 = $row['weeks_2']; $weeks_3 = $row['weeks_3']; $weeks_4 = $row['weeks_4']; if($count==0){ print'<br /><br /><center><b>TSE '.$tse_name.'</b></center>'; $count=1; } if ($tasks_week != $previous_tasks_week){ print '<br /><H3>Week ' . $tasks_week . '</H3><br />'; $previous_tasks_week = $tasks_week ; } if ($tasks_day != $previous_tasks_day){ print '<br /><b>Day ' . $tasks_day . '</b><br /><br />'; $previous_tasks_day = $tasks_day ; } if ($tasks_id != $previous_tasks_id){ print '<table width="90%" cellspacing="3" cellpadding="3" border="0"><tr><td width="30%" height="1">' . $tasks_id . '&nbsp- ' . $tasks_task . '</td><td halign="left" width="30%" height="1"><INPUT TYPE=CHECKBOX NAME="' . $tasks_id . '"" VALUE="1""> complete</td></tr></table>'; $previous_tasks_id = $tasks_id ; } } ?> <br /><br /> <INPUT TYPE=SUBMIT VALUE="submit"> </FORM> </blockquote> <br /><br /> </BODY> </HTML> what is supposed to happen.... each task has an id (task_id) anything that is checked i want to update the status in the db from a 0 to a 1. So the question is this... since every item is task_id how do I update multiple tasks to status 1?
  11. I have a form that has about 100 check boxes on it. 1 for each task id. What I want is to update a mysql db when you click submit. In other words... I want to take the boxes that are checked and enter that (the value will be 1 if checked) into the db according to the task id. How do I do this with the least effort (not defining each check with a different name staticly.) Currently I have : if ($tasks_id != $previous_tasks_id){ print '<table width="90%" cellspacing="3" cellpadding="3" border="0"><tr><td width="30%" height="1">' . $tasks_id . '&nbsp- ' . $tasks_task . '</td><td halign="left" width="30%" height="1"><INPUT TYPE=CHECKBOX NAME="' . $tasks_id . '"" VALUE="1""> complete</td></tr></table>'; $previous_tasks_id = $tasks_id ; } but Im not sure where to go from here. any help is appreciated.
  12. awesome - thank you that did it.
  13. Hello... What I want to do is print the $tse_name once above the output from the if statements. If I do another if statement it prints out 1 set of data - not everything as it does without the name. $id = $_GET['id']; $result = mysql_query ("SELECT tse.tse_id, tse.tse_name, tasks.tasks_id, tasks.tasks_task, tasks.tasks_week, tasks.tasks_day, tasks.tasks_order FROM tse, tasks WHERE tse.tse_id = $id ORDER BY tasks.tasks_week, tasks.tasks_day, tasks.tasks_order") or die(mysql_error()); while($row = mysql_fetch_array($result)) { $tasksans_id = $row['tasksans_id']; $tasks_tsedone = $row['tasks_tsedone']; $tasks_date = $row['tasks_date']; $tasks_mdone = $row['tasks_mdone']; $tasks_id = $row['tasks_id']; $tasks_task = $row['tasks_task']; $tasks_week = $row['tasks_week']; $tasks_day = $row['tasks_day']; $tasks_order = $row['tasks_order']; $tasks_add1 = $row['tasks_add1']; $tasks_add2 = $row['tasks_add2']; $tasks_add3 = $row['tasks_add3']; $tasks_add4 = $row['tasks_add4']; $tse_id = $row['tse_id']; $tse_name = $row['tse_name']; $tse_weekorder = $row['tse_weekorder']; $weeks_id = $row['weeks_id']; $weeks_1 = $row['weeks_1']; $weeks_2 = $row['weeks_2']; $weeks_3 = $row['weeks_3']; $weeks_4 = $row['weeks_4']; if ($tasks_week != $previous_tasks_week){ print '<br /><br /><H3>Week ' . $tasks_week . '</H3><br />'; $previous_tasks_week = $tasks_week ; } if ($tasks_day != $previous_tasks_day){ print '<br /><b>Day ' . $tasks_day . '</b><br />'; $previous_tasks_day = $tasks_day ; } if ($tasks_id != $previous_tasks_id){ print '<br />' . $tasks_task . '<br />'; $previous_tasks_id = $tasks_id ; } } Any help is appreciated - Im sure it's something easy but I'm braindead at the moment.
  14. OH MAN... well I found it - the weeks, weekorder in the FROM section jacked it up... took those out and it is fixed. Solved my own problem - thanks all
×
×
  • 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.