I have this line. in a php page that I'm working on most likely it's wrong but I just went from a example and messed around with it for a couple days.
$query = " SELECT $table2.contacts_id as contacts_id, $table.city_code FROM $table JOIN $table2 ON $table.contacts_id = $view";
#$query = "SELECT * FROM $table2,$table WHERE $table2.contacts_id = $view AND $table.city_code = $city_code ORDER BY id ASC";
That 2nd line works fine if I don't have SELECT from $table, $table2.. but I think that kinda explains what I'm tryin to do
I need to get 2 things from 2 tables
table2 has a contact_id number where I get my post value from example. contacts.php?view=2 in the table 2 it has that number 2.
Then table has a city_code in in so I need to get the table.city_code out and put it into a link like this.
echo "<a href='../workorder/workorder.php?view=" .$row['id'] . "'>WorkOrder ".$row['city_code']. "-".$row['id'] . "</a><br>";
This will show any workorder for the cust that = the post vaule example view=2 will show any workorder from the customer that a value of 2.
I want it to show like this
WorkOrder - TOR-22
WorkOrder - TOR-25
for example so then I can go back and see all the work orders for that certain customer rather then doing reports.