I am very new to PHP (this is my first project) everyone at stackoverflow has been a tremendous amount of help.
What I am trying to do is update the status of a lead in mysql when the submit button is pressed. I currently have been able to get the select field to display what is currently in the database. Now when the user presses submit I need it to write that data back to that lead id. Below is the code I have so far.
<select name="updatestatus" id="updatestatus">
<option value="New" <?php if ($lead->status == "New") echo "selected"; ?> >New</option>
<option value="In Process" <?php if ($lead->status == "In Process") echo "selected"; ?> >In Process</option>
<option value="Dead" <?php if ($lead->status == "Dead") echo "selected"; ?> >Dead</option>
</select>
and:
$valuesstatus["status"] = MySQL::SQLValue($updatestatus, MySQL::SQLVALUE_TEXT);
$where["id"] = MySQL::SQLValue($cid, MySQL::SQLVALUE_TEXT);
$db->UpdateRows(TABLE_LEADS, $valuesstatus, $where);
now if I change the $updatestatus to something static like “New” then it post to the data base no problem. Right now with the $updatesstatus variable I am getting NULL in the db.
Any suggestions you guys have would be appreciated!
I got this resolved by adding the following: