Connecting Tech Pros Worldwide Forums | Help | Site Map

drop down menu list update *help*

Member
 
Join Date: Jan 2009
Location: USA
Posts: 118
#1: Sep 23 '09
i can query the list fine using:

Expand|Select|Wrap|Line Numbers
  1. select list.list, many_table.list_id_fk from list left join many_table
  2. on list.id = many_table.list_id_fk and many_table.userid = 'UserId';
  3.  
that populates the list per user id.

now when the user selects a new item from the list
it does not update

here is the update query:
Expand|Select|Wrap|Line Numbers
  1. $updateSQL = sprintf("UPDATE list_many SET list_many_id_fk=%s, UserIdFk='1', `Date`=now() WHERE Id=%s",
  2. GetSQLValueString($_POST['list_many_idfk'], "int"),
  3. GetSQLValueString($_POST['UserIdFk'], "int"),
  4. GetSQLValueString($_POST['Date'], "date"),
  5. GetSQLValueString($_POST['Id'], "int"))
  6.  
sorry posted in php; its mysql issue.

thanks in advance for your help!



theo

Member
 
Join Date: Jan 2009
Location: USA
Posts: 118
#2: Sep 24 '09

re: drop down menu list update *help*


this has been resolved! here is the resolution:

this has been resolved! i needed to limit what the form was updating, just the list fk id and date that the new update was entered.

$updateSQL = sprintf("update ASBodyType as a
left join BSType as b
on b.Id = a.BodyType
set a.BodyType=%s, a.Date=now()
where a.UIdFk='1'",
GetSQLValueString($_POST['BodyType'], "int"));


thanks again for your help!
Reply