How to make so that when the output of the table output information instead of the id?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
After fetching I am bringing ShippingOffer.station_id , station_id refer to the table which contains the name of the stations. But when output to screen is drawn id how to make to display the value(station name) related to this id?

code:
<?php$host = 'localhost';$user = 'mysql';$pass = 'mysql';$db_name = 'tguquest';$link = mysql_connect($host, $user, $pass);mysql_select_db($db_name, $link);$sql = mysql_query("SELECT ShippingOffer.shipping_starts_at, ShippingOffer.station_id FROM `ShippingOffer` JOIN `ShippingRequest` USING (station_id) WHERE ShippingOffer.station_id_end = ShippingRequest.station_id_end");$i = 0;while ($row  = mysql_fetch_row($sql)){$arr_so[$i] = $row;echo "<p>".$arr_so[$i][1].""; $i++; } ?>
by | 12 views

1 Answer

0 like 0 dislike
Check
SELECT ShippingOffer.shipping_starts_at, ShippingOffer.station_id, s.name as StationName --<FROM ShippingOffer JOIN ShippingRequest USING (station_id) LEFT JOIN station as s ON s.id = ShippingOffer.station_id --<WHERE ShippingOffer.station_id_end = ShippingRequest.station_id_end
by
110,608 questions
257,186 answers
0 comments
36,634 users