My scripts are doing a lookup of transactions in table B. Each transaction contains an integer which is an ID of the business for each transaction. I also want the name (a varchar) of the business in the original transaction. My solution was to do a 2nd lookup for each transaction record and this works, but I would like to be able to sort the 1st transaction by the business name. I suspect the answer is to do a left-join transaction and get the name from that. However, I've never mastered left join and even though I looked it up again, I'm still not sure how it works. So, let me give an example of how I'm doing it now and maybe someone can suggest a better way.
$queryString = select * from tableB;//(truth be told, table B is called 'trips')
$result = mysqli....
while($array=mysqli_fetch_assoc($result)
{
$queryString2 = select bizname from tableA where ID = $array[ID]//(tableA is called 'companies')
Any help would be appreciated.
Jeff Sandler