I got the above error of shell_exec() has been disabled for security reasons as I haven't used this command in my code(Below).I am try to pass the information from my database table by using a JSON array.
My database has two tables
1) Market
2) signup
Initially i get the rows in the result variable(from my Market Table) and I iterate through these rows and from this result(by using username from Market table) further i apply query to get the data from my signup Table.
Then i got this error:
Warning: shell_exec() has been disabled for security reasons in/home/u636455177/public_html/market.php on line 25
include 'dbconnect.php';
$sql = " SELECT `item`,`encodedimage`,`currentbid`,`time`,`username`,`tag`,`itemdescription` FROM `Market`;";
$json = array();
$result = mysqli_query($con,$sql);
while( $row = mysqli_fetch_array($result) )
{
$username = $row['username'];
$sql2 = "SELECT `address`,`city`,`phone`,`email` FROM `signup` WHERE username='$username' ";
$result2 = mysqli_query($con,$sql2);
$row2 = mysqli_fetch_array($result2);
$add = array(
'encodedImage' => $row['encodedimage'],
'item' => $row['item'],
'currentbid' => $row['currentbid'],
'time' => $row['time'],
'username' => $row['username'],
'tag' => $row['tag'],
'itemdescription' => $row['itemdescription'],
`address` => $row2['address'],
`city` => $row2['city'],
`phone` => $row2['phone'],
`email` => $row2['email']
);
array_push($json,$add);
}
$jsonString = json_encode($json);
echo $jsonString;
?>
Sample output:
[{"encodedImage":"skdbvksdbv","item":"itemname","currentbid":"200","time":"80:00","username":"hb9996","tag":"electronics","itemdescription":"itemDesc","":"hb99960@gmail.com"}]
One more thing from JSON array i am getting only result of email but other results like address,city,phone are not showing. What was the problem with this and the above error?
Code of dbconnect.php
<?php
$con = mysqli_connect("mysql.hostinger.in","useranme","password","mydb");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
?>
Link of website and the file where the error is occuring:
http://hammertime.16mb.com
http://hammertime.16mb.com/market.php