djfox Posted July 16, 2007 Share Posted July 16, 2007 Here is my code: $res = mysql_query("SELECT id, name, description, url, price, preview FROM collection WHERE id='$c[2]'"); $comico = mysql_fetch_row($res); mysql_free_result($res); { echo "<a href='sell7.php?id=$comico[0]&p=$comico[4]'>"; echo "<img src='collection/$comico[5]' border=0></a>"; } Here is my problem: $comico[0] and $comico[5] appear fine but $comico[4] is not showing up. Can someone look me over and see if I messed up somewhere? Quote Link to comment Share on other sites More sharing options...
trq Posted July 16, 2007 Share Posted July 16, 2007 <?php if ($res = mysql_query("SELECT id, name, description, url, price, preview FROM collection WHERE id='{$c[2]}'")) { if (mysql_num_rows($res)) { $comico = mysql_fetch_row($res); mysql_free_result($res); echo "<a href='sell7.php?id={$comico[0]}&p={$comico[4]}'>"; echo "<img src='collection/{$comico[5]}' border=0></a>"; } } else { echo mysql_error(); } ?> Quote Link to comment Share on other sites More sharing options...
djfox Posted July 16, 2007 Author Share Posted July 16, 2007 No error message appears. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted July 16, 2007 Share Posted July 16, 2007 the code seems ok to me and when i create an array as follows $comico = ARRAY("me", "name", "desc", "url","20.44","preview"); which is what the query code does, but with your values from the database and if I run your echo statements I get the following source code <a href='sell7.php?id=me&p=20.44'><img src='collection/preview' border=0></a> which, based on my array is exactly what it should say Quote Link to comment Share on other sites More sharing options...
djfox Posted July 16, 2007 Author Share Posted July 16, 2007 Hm, ok, it must be something elsewhere in the code then. I`ll check over the whole file and see what I can find. Thanks for checking it over. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted July 16, 2007 Share Posted July 16, 2007 if the price isnt showing up check your query is correct or that there are actual values in the orice column Quote Link to comment Share on other sites More sharing options...
djfox Posted July 16, 2007 Author Share Posted July 16, 2007 if the price isnt showing up check your query is correct or that there are actual values in the orice column Ah that`s what it was. I was calling the price value from the wrong table. Thanks much. 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.