How to get data from a SQL database to a AMX Netlinx System using PHP

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:

AMX-PHP-SQL

I will add a like to php and amx code shortly.

Fireworks, Blackheath

Fireworks Clapham Common

5th November Bonfire pics

IMG_0394.JPG

I will be going to Blackheath bonfire night on Saturday, I will hopefully get some good shots there with the DSLR.

How to select data from 2 different tables

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

Page 27 of 28« First...10202425262728