Skip to content

Instantly share code, notes, and snippets.

@AndrewRussellHayes
Last active December 28, 2015 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRussellHayes/7539972 to your computer and use it in GitHub Desktop.
Save AndrewRussellHayes/7539972 to your computer and use it in GitHub Desktop.
PHP quick db table dump. May have issues, storing for later use. Definitely connects and pulls data from a simple table.
<?php
// Connects to your Database
mysql_connect("db.host", "uname", "pwd") or die(mysql_error());
mysql_select_db("ectmenu") or die(mysql_error());
$data = mysql_query("SELECT * FROM pizza") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{ // here is the menu code below
print"<p>
<br/>
<button class=\"btn btn-large btn-primary\" type=\"button\">".$info['name'] . "</button>
<div>".$info['description'] . "</div>
</p>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment