Advertisement
TheGerman

Asterisk queue_log file import into mySQL - mysql_connect.php

Nov 19th, 2020
1,267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2. $servername='localhost';
  3. // username and password to log onto db server
  4. $dbuser='mysqlusername';
  5. $dbpassword='mysqlpassword';
  6. // name of database
  7. $dbname='asterisk';
  8.  
  9. //
  10. ////////////////////////////////////////
  11. ////// DO NOT EDIT BELOW  /////////
  12. ///////////////////////////////////////
  13. //
  14. connecttodb($servername,$dbname,$dbuser,$dbpassword);
  15. function connecttodb($servername,$dbname,$dbuser,$dbpassword) {
  16.         global $link;
  17.         $link = mysqli_connect("$servername","$dbuser","$dbpassword");
  18.         if(!$link) {die("Could not connect to MySQL");}
  19.         mysqli_select_db($link,"$dbname") or die ("could not open db".mysql_error());
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement