Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function BROWSE($db,$sql){
- $id=mysql_connect("localhost","root","") or die("Serverul nu este pornit sau instalat");
- $bd=mysql_select_db($db) or die ("Nu ai creat baza de date");
- $res=mysql_query($sql) or die("Comanda este incorecta");
- $nr_col=mysql_num_fields($res);
- print "<table border='2'><TR>";
- for($i=0; $i<$nr_col;$i++)
- print "<TD><B>".mysql_field_name($res,$bi)."</B></TD>";
- print"</TR>;
- while($r=mysql_fetch_array($res))
- {
- print "<TR>";
- for($i=0;$i<$nr_col;$i++)
- print"<TD>".$r[$i]."</TD>";
- print"</TR>";
- }
- print "</table>";
- mysql_close($id);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement