I have a Invoice Table (with 3 fields InvoiceID, InvoiceDate, CustomerLookup) .
The CustomerLookup is a lookup field of Customer Table which has 2 fields(CustomerID, CustomerName)
I need to get the CustomerID of the customer from a given InvoiceID
$Invoice_from = get_sql_from('Invoice');
$Invoice_id = intval($_REQUEST['InvoiceID']);
$Invoice_fields = get_sql_fields('Invoice');
//Need the syntax to get CustomerID for a given InvoiceID
Lookup field ID
Re: Lookup field ID
Hi,
acutally, if you need the CustomerID, this is the data stored in the CustomerLookup field of the Invoice table.
SELECT CustomerLookup from Invoice where InvoiceID = ID_YOU_SEARCH_FOR
acutally, if you need the CustomerID, this is the data stored in the CustomerLookup field of the Invoice table.
SELECT CustomerLookup from Invoice where InvoiceID = ID_YOU_SEARCH_FOR
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Lookup field ID
Appreciate it will try
Re: Lookup field ID
Hi
I used
I get this error
Parse error: syntax error, unexpected 'CustomerLookup' (T_STRING) in /mydomain/TEST.php on line...
Please advise
I used
Code: Select all
$IDofPatient=SELECT PatLU from Billing where BillingID = 2;
echo $IDofPatient;
Parse error: syntax error, unexpected 'CustomerLookup' (T_STRING) in /mydomain/TEST.php on line...
Please advise
Re: Lookup field ID
Sorry
Code: Select all
$IDofCustomer=SELECT CustomerLookup from Invoice where InvoiceID = 2;
echo $IDofCustomer;
Re: Lookup field ID
I was able to figure that out
it should be
The key as sqlValue instead of sql
Thanks
it should be
Code: Select all
$IDofCustomer= sqlValue("select CustomerLookup from {$Invoice_from} and InvoiceID= {$Invoice_id}", $eo);
Thanks