Advertisement
Guest User

Untitled

a guest
May 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. <html><body><h1>Records</h1><?
  2. mysql_connect(localhost,username,password);
  3. @mysql_select_db(database) or die( "Unable to select database");
  4. $query="SELECT * FROM contacts";
  5. $result=mysql_query($query);
  6. mysql_close();
  7. $i=0;
  8. while ($i < mysql_numrows($result)) {
  9. $name=mysql_result($result,$i,"name");
  10. $phone=mysql_result($result,$i,"phone");
  11. echo "<b>$name</b><br>Phone:$phone<br /><br /><hr /><br />";
  12. $i++;
  13. }
  14. ?></body></html>
  15.  
  16.  
  17.  
  18. ==========================================
  19.  
  20. def index():
  21.     return HTML(BODY(H1('Records'), db().select(db.contacts.ALL)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement