php - Errors getting values from 2 MySQL tables -


i having table relationship. have table adds new procurement items, has 2 columns - line_manager_remark , c_level_remark shows approval status line manager , c level executive.

enter image description here

the values these columns gotten table

enter image description here

now, having issues getting status (definitions) of items. not work.

this have done

select     a.*,     b.*     request_items a,     request_status b     a.line_manager_remark = b.id     ,     a.c_level_remark = b.id     ,     a.request_id = '$id'     ,     state = 'active' 

select     request_items.*,     request_status_line_manager.definition line_manager_status,     request_status_c_level.definition c_level_status,     request_items     inner join request_status request_status_line_manager         on request_items.line_manager_remark = request_status_line_manager.id     inner join request_status request_status_c_level         on request_items.c_level_remark = request_status_c_level.id     request_items.state = 'active'     ,     request_items.request_id = '$id' 

i note - if '$id' evidence of php / perl string interpolation stop immediately , use parameterised queries, otherwise query vulnerable sql injection (and assume request_items.request_id int instead of text column too...)


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -