LJackson
05-20-2009, 10:23 PM
Hi Guys,
i am new at this ajax/javascript stuff but i would like to use it :D
i have a drop down list with 5 values in it.
entertainment
computing
electronics
clothing
misc
and depending on that selected value i would like the following query to be run
$stores = "SELECT *
FROM stores
WHERE category = 'Electronics'";
$query = mysql_query($stores);
while ($row = mysql_fetch_array($query)){?>
<div class='storecontainer'>
<div class='storeheader'>
<?php echo $row['storeName'];?>
</div>
<div class='storeinfo_link'>
<div class='storeimg'>
<?php print '<img src="' . $row['logo'] .'" alt="' . $row['storeName'] .'" />';?>
</div>
<div class='visitstore'>
<a href="<?php print $row['storeLink'];?>"><img src="images/visitstore.gif" alt="Visit Store" title="Visit Store" border="0" /></a>
</div>
</div>
<div class='storedesc'>
<?php echo $row['description'];?>
</div>
</div>
<?php
}
?>
now im not sure if this code is ok or if it will need to be translated into js? also the category = 'Electronics' bit of my statment will need to represent the current list value?
can anyone help me get this sorted out, if it is at all possible
many thanks
Luke
i am new at this ajax/javascript stuff but i would like to use it :D
i have a drop down list with 5 values in it.
entertainment
computing
electronics
clothing
misc
and depending on that selected value i would like the following query to be run
$stores = "SELECT *
FROM stores
WHERE category = 'Electronics'";
$query = mysql_query($stores);
while ($row = mysql_fetch_array($query)){?>
<div class='storecontainer'>
<div class='storeheader'>
<?php echo $row['storeName'];?>
</div>
<div class='storeinfo_link'>
<div class='storeimg'>
<?php print '<img src="' . $row['logo'] .'" alt="' . $row['storeName'] .'" />';?>
</div>
<div class='visitstore'>
<a href="<?php print $row['storeLink'];?>"><img src="images/visitstore.gif" alt="Visit Store" title="Visit Store" border="0" /></a>
</div>
</div>
<div class='storedesc'>
<?php echo $row['description'];?>
</div>
</div>
<?php
}
?>
now im not sure if this code is ok or if it will need to be translated into js? also the category = 'Electronics' bit of my statment will need to represent the current list value?
can anyone help me get this sorted out, if it is at all possible
many thanks
Luke