SHARE
TWEET

Untitled

a guest Aug 13th, 2016 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $con_error='Could not connect';
  4.  
  5. $mysql_host='localhost';
  6. $mysql_user='root';
  7. $mysql_pass='';
  8. $mysql_db='new_database';
  9.  
  10. /*connect to server / database*/
  11. $mysqlcon=@mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die($con_error);
  12.  
  13. /*select database*/
  14. mysql_select_db($mysql_db, $mysqlcon) or die($con_error);
  15.    
  16. require 'database.php';
  17.  
  18. $query="SELECT * FROM comida ORDER BY id";
  19.  
  20. if ($query_run = @mysql_query($query)) {
  21.  
  22.     while ($query_run= mysql_fetch_array($query_run)) {
  23.         $platillo=$query_run['platillo'];
  24.         $calorias=$query_run['calorias'];
  25.  
  26.         echo ' <br> platillo '.$platillo.' ofrece '.$calorias.'<br>';
  27.     }
  28.  
  29. } else {
  30.     echo '<br> could not connect <br>';
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top