Advertisement
Bille

Simple MySQL query from PHP

Sep 17th, 2011
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1. <?php
  2. $link = mysql_connect("localhost", "mysql_user", "mysql_password");
  3. mysql_select_db("mydatabase", $link);
  4.  
  5. $result = mysql_query("SELECT * FROM mytable", $link);
  6. $num_rows = mysql_num_rows($result);
  7.  
  8. echo "$num_rows Rows\n";
  9. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement