Hi There,
I am having a major problem with updating multiple rows in my Database from my php script.
It’s a simple staff rating system that I am developing for our call centre.
Below is my current code:
$post_record = $_POST['record'];
$post_complete = $_POST['complete'];
$post_satisfied = $_POST['satisfied'];
$post_reason = $_POST['reason'];
$post_other = $_POST['other'];
$post_rate = $_POST['rate'];
$post_overall = $_POST['overall'];
$post_proceed = $_POST['proceed'];
foreach ($post_record as $callback_id) {
$edit_callback = mysql_query("UPDATE callbacks SET callback_complete='1', callback_staff='" . $callback_staff . "', callback_satisfied='" . $post_satisfied . "', callback_reason='" . $post_reason . "', callback_other='" . $post_other . "', callback_rate='" . $post_rate . "', callback_overall='" . $post_overall . "', callback_proceed='" . $post_proceed . "' WHERE callback_id='" . $callback_id . "'");
}
And my form looks something like this:
<tr>
<td width="20"><input type="hidden" name="record[30]" value="30" /><input name="complete[30]" type="checkbox" value="1" /></td>
<td><strong>Mr Test User</strong><br />
<small>USA</small><br />
<font color="#000000"><strong>Darron</strong></font></td>
<td>+1 654 7624<br />
test@test.com</td>
<td>ACR</td>
<td>Manual</td>
<td><select name="satisfied[30]">
<option selected="selected">Yes</option>
<option >No</option>
</select></td>
<td><select name="reason[30]">
<option selected="selected">Price</option>
<option >Offering</option>
<option >Timeline</option>
<option >Lack of funding</option>
<option >Other</option>
</select></td>
<td><select name="other[30]">
<option selected="selected">Yes</option>
<option >No</option>
</select></td>
<td>SA Flyer</td>
<td><select name="rate[30]">
<option selected="selected">1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select></td>
<td><select name="overall[30]">
<option selected="selected">1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select></td>
<td><select name="proceed[30]">
<option selected="selected">Yes</option>
<option >No</option>
</select></td>
</tr>
<tr>
<td width="20"><input type="hidden" name="record[31]" value="31" /><input name="complete[31]" type="checkbox" value="1" /></td>
<td><strong>Mrs Nittaya Beetge</strong><br />
<small>Thailand</small><br />
<font color="#0000ff"><strong>Michelle</strong></font></td>
<td>+66 87 337 3367<br />
nongneungka@gmail.com</td>
<td>PPL-A</td>
<td>Manual</td>
<td><select name="satisfied[31]">
<option selected="selected">Yes</option>
<option >No</option>
</select></td>
<td><select name="reason[31]">
<option selected="selected">Price</option>
<option >Offering</option>
<option >Timeline</option>
<option >Lack of funding</option>
<option >Other</option>
</select></td>
<td><select name="other[31]">
<option selected="selected">Yes</option>
<option >No</option>
</select></td>
<td>SA Flyer</td>
<td><select name="rate[31]">
<option selected="selected">1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select></td>
<td><select name="overall[31]">
<option selected="selected">1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select></td>
<td><select name="proceed[31]">
<option selected="selected">Yes</option>
<option >No</option>
</select></td>
</tr>
Any ideas about where I may be going wrong?