Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. function BROWSE($db,$sql){
  3. $id=mysql_connect("localhost","root","") or die("Serverul nu este pornit sau instalat");
  4. $bd=mysql_select_db($db) or die ("Nu ai creat baza de date");
  5. $res=mysql_query($sql) or die("Comanda este incorecta");
  6.  
  7. $nr_col=mysql_num_fields($res);
  8. print "<table border='2'><TR>";
  9. for($i=0; $i<$nr_col;$i++)
  10. print "<TD><B>".mysql_field_name($res,$bi)."</B></TD>";
  11. print"</TR>;
  12. while($r=mysql_fetch_array($res))
  13. {
  14. print "<TR>";
  15. for($i=0;$i<$nr_col;$i++)
  16. print"<TD>".$r[$i]."</TD>";
  17. print"</TR>";
  18. }
  19. print "</table>";
  20. mysql_close($id);
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement