As part of a system upgrade I did a year or so back (Remote studio system)I needed to get data back from a SQL database. At the time AMX did have a way of doing this it involved using ASP pages with predefined SQL queries. But this system needed to be more flexible, I wanted to be able to send SELECT,UPDATES and INSERTS directly from the AMX Code.
This is the way the system passes the information:
I will add a like to php and amx code shortly.
I will be going to Blackheath bonfire night on Saturday, I will hopefully get some good shots there with the DSLR.
Tables : CustomerTBL , OrdersTBL
CustomerTBL
custID custName
1 Tom
2 Laura
OrdersTBL
orderID custID OrderTotal
300 1 10
301 2 20
302 1 5
Requirement
Customer Name, orderID and OrderTotal for Tom with 1 SQL queery
SQL Query
SELECT a.custName , b.orderID , b.OrderTotal
FROM CustomerTBL as a INNER JOIN OrdersTBL as b ON a.custID = b.custID
WHERE a.custName = ‘Tom’
Result
custName orderID OrderTotal
Tom 300 10
Tom 302 5