Advertisement
Guest User

Untitled

a guest
Feb 5th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. function get_url()
  3. {
  4.     $host="localhost";
  5.     $user="********";
  6.     $pass="********";
  7.     $db_name="********";
  8.     $link=mysql_connect($host,$user,$pass);
  9.     mysql_select_db($db_name,$link);
  10.    
  11.     $sql = mysql_query("SELECT * FROM `URL`") or die("Base error");
  12.     $list_url = array();
  13.     while($row = mysql_fetch_array($sql))
  14.     {
  15.         //echo $row['URL'];
  16.         array_push($list_url, $row['URL']);
  17.     }
  18.     return $list_url;
  19. }
  20.  
  21. $a = get_url();
  22. echo $a[0];
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement