Jump to content

Eccentricson

New Members
  • Posts

    8
  • Joined

  • Last visited

Eccentricson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a PHP/HTML form, one of the fields isn't sending the entire string on submit, instead it's only sending the first word before the first space. I can't find out why.. <span id='MitigationOnTrack'><input type='text' name='mitigation[$row_id][status]' value=". $data['status'] ."></span></td> Any ideas?
  2. This worked with a few tweaks to it. Thanks so much!!! I appreciate it!
  3. Unfortunately, due to the sensitive data, I can't post the source code, without significant data scrubbing. I have changed it have one single form, I have figured the best way to fix this, is to use variables for the names of the fields. Simply because the last ID in the database was setting the data for that name and the form was using the same data over and over until the while loop ended. If this makes sense. Your guys help has helped me a lot, I really appreciate it!! If I was making any money on this project, I'd donate.
  4. Here's the sourcecode: <tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=1><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=Watch></span></td><td width='758'><input type=text name='mitigation_id' value=1><textarea rows=5 cols=100 name='mitigation_notes'></textarea></td></tr><tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=2><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=Watch></span></td><td width='758'><input type=text name='mitigation_id' value=2><textarea rows=5 cols=100 name='mitigation_notes'></textarea></td></tr><tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=3><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=Watch></span></td><td width='758'><input type=text name='mitigation_id' value=3><textarea rows=5 cols=100 name='mitigation_notes'></textarea></td></tr><tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=4><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=Watch></span></td><td width='758'><input type=text name='mitigation_id' value=4><textarea rows=5 cols=100 name='mitigation_notes'></textarea></td></tr><tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=5><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=Watch></span></td><td width='758'><input type=text name='mitigation_id' value=5><textarea rows=5 cols=100 name='mitigation_notes'></textarea></td></tr><tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=6><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=Watch></span></td><td width='758'><input type=text name='mitigation_id' value=6><textarea rows=5 cols=100 name='mitigation_notes'></textarea></td></tr>
  5. Yes, the IDs are correct for each row it spits out. The submit button is in the same form tag. I have a form in the beginning, then this form at the while loop and I close both at the end of the file. I don't have any JS associated either.
  6. Is your script returning errors? What's the problem here? Here's how I connect to my database in my scripts: $link = mysql_connect('host', 'username', 'password'); mysql_select_db('database_name'); I have this in a functions file, and just require that file in every other file I create for the site. It's nice, short and quick. Your table syntax looks correct, but are you receiving an error?
  7. I have a form, it's reading the mysql database. I have a while loop to display all of the fields in the table so you can edit it. Yes, it displays the fields, but I'm having problems with the update part, when I specify the ID (which is a hidden field) it takes the last field in the form and uses that to update. For example: UPDATE mitigations SET `status`='Watch', `notes`='test6' WHERE id='6';UPDATE mitigations SET `status`='Watch', `notes`='test6' WHERE id='6';UPDATE mitigations SET `status`='Watch', `notes`='test6' WHERE id='6';UPDATE mitigations SET `status`='Watch', `notes`='test6' WHERE id='6';UPDATE mitigations SET `status`='Watch', `notes`='test6' WHERE id='6';UPDATE mitigations SET `status`='Watch', `notes`='test6' WHERE id='6'; I need id to actually get the ID from the form where it's a hidden field. It works now, but only for the last field. Make sense? Here's the actual code I have on the edit form itself: <?php while ($data = mysql_fetch_array($mitigation_query)) {echo "<form><tr><td width='56' height='20px'><input type=hidden name='mitigation_id' value=". $data['id'] ."><span id='MitigationOnTrack'><input type='text' name='mitigation_status' value=". $data['status'] ."></span></td><td width='758'><input type=text name='mitigation_id' value=". $data['id'] ."><textarea rows=5 cols=100 name='mitigation_notes'>" . $data['notes'] ."</textarea></td></tr></form>"; } ?>
×
×
  • 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.