as a php noob im teaching myself but have hit a little problem and could use a helping hand please.
I'm currently making a query to tbl_products to grab info as follows:
$mysql_hostname = "localhost";
$mysql_user = "hidden";
$mysql_password = "hidden";
$mysql_database = "hidden";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Oops some thing went wrong");// we are now connected to database
$result = mysql_query("SELECT * FROM tbl_products ORDER BY bankIds"); // selecting data through mysql_query()
while($data = mysql_fetch_array($result))
{
echo ''.$data['bankIds'].'|'.strip_tags($data['sku']).'|'.strip_tags($data['productTitle']).'|'.strip_tags($data['productTitle']).'|'.strip_tags($data['prodDesc']).'|'.strip_tags($data['seed']).',http://cdn.shopify.com/s/files/1/0709/2915/files/'.strip_tags($data['productImg']).'<br/>';
}
That works fine, but now i want to display the name of ['bankIds'] by making another query (if needed) to the table named "tbl_seedBank".
- tbl_seedBank
- id
- bankTitle
At the moment "$data['bankIds']" will echo out the id number, i want to be able to grab the bankTitle from the id and echo it out instead of the id number...
Hope this makes sencse lol
Thank you so much for taking the time to read about my problem. ~ Rory
'; – Sarath Nov 29 '14 at 14:46