SQL / Scoped query

SQL / Scoped query

nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
edited November 2012 in Editor
Hi,

1) How would you formulate:

SELECT UNameF,UCustomerName FROM tblUsers,tblCustomers WHERE tblUsers.ID = SESSSION[ID} AND tblCustomers.f_UserID = tblUsers.UserID

(the goal is to select all the customers of one salesperson).

2) Are PHP sessions compatible with the PHP JSON output? I don't want to show the above output merely with a $_GET parameter...

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    1. You'd need to use the `where` method ( http://editor.datatables.net/docs/current/php/class-DataTables.Editor.html#_where ) to do that (assuming the first part of your condition is on the parent table), which is looks like it is). Which tables to the two selected fields belong to?

    2. PHP JSON output? As in the string result of encode_json()? Yes you can just assign the value to a session parameter. You don't need to json encode the PHP array - you can just assign the array itself to a PHP session parameter.

    Allan
  • nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
    Thanks, seems to work.
This discussion has been closed.