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? Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/ 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(); } ?> Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/#findComment-299896 Share on other sites More sharing options...
djfox Posted July 16, 2007 Author Share Posted July 16, 2007 No error message appears. Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/#findComment-299900 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 Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/#findComment-299901 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. Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/#findComment-299902 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 Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/#findComment-299903 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. Link to comment https://forums.phpfreaks.com/topic/60290-solved-can-someone-look-my-code-over-for-any-mistakes/#findComment-299913 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.