rseigel Posted January 29, 2013 Share Posted January 29, 2013 I'm using the following code: $result = mysql_query('SELECT * FROM tmp_price_compare WHERE tmp_price_compare.supplier_reference NOT IN (SELECT product_supplier_reference FROM product_supplier)') or die(mysql_error()); echo "NEW PRODUCTS<br /><br />"; while($row = mysql_fetch_array($result)) { echo "<a href=https://www.mysupplier.com/item/item.lasso?dsc2=" . $row['supplier_reference'] . echo $row['supplier_reference'] . echo"</a><br />"; } The SELECT works perfectly and results are as expected. I'm having trouble getting the link coded correctly. I'm sure it's something silly. I was hoping someone with more experience than I could spot it. Thanks, Ron Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 29, 2013 Share Posted January 29, 2013 1 HTML element attributes need to be surrounded in quotes. 2. This code would produce parse errors. You cannot concatenate an "echo" to another one. 3. You never closed the opening <a> tag. Quote Link to comment Share on other sites More sharing options...
rseigel Posted January 29, 2013 Author Share Posted January 29, 2013 Thanks Jessica. You are always awesome at pointing me in the right direction without spoon feeding it. Great way to learn. The not closing the opening <a> tag was the one that I was overlooking. Here's the final code that works: while($row = mysql_fetch_array($result)) { echo "<a href=https://www.bnfusa.com/item/item.lasso?dsc2="; echo $row['supplier_reference']; echo ">"; echo $row['supplier_reference']; echo"</a><br />"; } Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.