Skip to content

Instantly share code, notes, and snippets.

@kelso
Created March 23, 2014 21:06
Show Gist options
  • Save kelso/9729836 to your computer and use it in GitHub Desktop.
Save kelso/9729836 to your computer and use it in GitHub Desktop.
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error());
mysql_select_db("mydb");
$result = mysql_query("SELECT price, product_id FROM product_attributes");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo "price: ".$row[0]
echo "product_id".$row[1]
}
mysql_free_result($result); // clean memory
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment