Last active
December 28, 2015 17:59
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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