Menu
[CODE] <?php
mysql_connect(‘localhost’,’root’,”);
mysql_select_db(“ajax”);
$query=”SELECT * FROM xxxx”;
$result= mysql_query($query);
while($row= mysql_fetch_array($result)){
$rating=$row[‘ID’];
echo “<img src='”.$row[‘filepath’].”‘>”;
echo “<br>”;
echo “<div id='”.$row[‘ID’].”‘ value='”.$row[‘ID’].”‘ onclick=’getrating();’>Craves: “.$row[‘craves’].”</div>”;
echo “<br>”;
}
im trying to get what picture the user selected to rate.
?>
<script type=”text/javascript” >
function getrating(){
var x= document.getElementById(“<?php echo $row[‘ID’]; ?>”);
alert(x)
}
</script>