This is my code. Where I'm wrong?
<?php
$connection = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD);
mysql_select_db($DB_NAME);
$img = mysql_query("SELECT * FROM wp_bwg_image");
while($res = mysql_fetch_array($img)){
echo $res;
}
?>
From this table I want to take any pictures.
$res
is probably an object or array, tryprint_r($res);
orvar_dump($res);
to see what if anything you are ending up with.mysql_
extensions has been depreciated in PHP 5.5 and is now removed in PHP 7. See this