I'm having difficulties with the onclick jquery within my php code, how do I get a php variable so that name=variable and price=variable?
<?php
$result = mysqli_query($db,"SELECT * FROM table");
while($row = mysqli_fetch_array($result)) {
echo '<ul>';
echo '<li>' . $row['selection'] . '<div style="float:right;"><a href="#" onclick="simpleCart.add('name='. $row['selection'] . ','price='. $row['price'] .');return false;
"> '. $row['price'] . '</a></div></li>';
echo '</ul>';
}
?>
How do I get around this? Thanks