1

I'm really new to php And i have written this code to grab data from Mikrotik's Wireless Registration Table Full Code

<?php

use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar';

try {

    $client = new RouterOS\Client('mikrotikIP', 'User', 'PW');

} catch (Exception $e) {

    die($e);

}

// Ambil List Registration Table

    $getWlRegtable = $client->sendSync(new RouterOS\Request('/interface wireless registration-table print'));

foreach ($getWlRegtable as $getWlRegtable){

    if($getWlRegtable->getType() === RouterOS\Response::TYPE_DATA) {

      echo 'Interface : ', $getWlRegtable->getProperty('interface'), "<br>";

And the question is,based on the code,how can i post the output of the echos to MySQL DB. I'm really new to this DB and PHP stuff. And sorry for my bad english. Thanks.

mario
  • 144,265
  • 20
  • 237
  • 291
  • Welcome to Stackoverflow. You will find many people willing to help here, but you are expected to show research effort, and show us what you have tried, if anything. For example: do you have a database set up? Are you able to connect to it? If not, these are fundamentals that you should probably tackle before asking this question. – random_user_name Oct 10 '18 at 14:51
  • I have setted up the database and the connection to the DB works just fine,i just doesnt inculde it on the script i posted. Sorry for that. Maybe you could give me some reference? – Issaa Noorendra Oct 10 '18 at 14:53
  • 1
    you can easily google for tutorials showing you how to insert data into a mysql database using PHP. There are hundreds of them, literally. Have you done any research at all?? – ADyson Oct 10 '18 at 15:34

0 Answers0