Hi,
I've googled and searched through pages and tutorials to avoid bothering you guys with another question. But I've found nothing for this case. Can you please help?
I have this code:
<?php
$pass = $_GET['pass'];
$query="SELECT ID, Name, Description, Location, ListPrice, Price, Image FROM proclist WHERE ID = '$pass'";
$status=mysql_query($query) or die( "Query Failed.");
$nt=mysql_fetch_array($status); ?>
<?php
$location = explode(",", "$nt[Location]");
$price = explode (",", "$nt[Price]");
$listprice = explode (",", "$nt[ListPrice]");
$count_values = sizeof($location);
$loop_count=0;
while ($loop_count < $count_values) { ?>
<?php echo '' . $location[$loop_count] . '';?>
Our Price:
<?php echo $price[$loop_count];?>
List Price:
<?php echo $listprice[$loop_count];
$loop_count++;
}
echo $location[0];
?>
<
<?php
$pass = $_GET['pass'];
$location = explode(",", "$nt[Location]");
echo $location[$pass];
mysql_close($link);
?>
Every thing works except at the end of the code. "echo $location[$pass];" works when $pass is equal 1 or 2 (displays the correct value) but NOT when $pass is equal to 0 (does not display anything).
Any ideas?
Thank you.