Just solved it!
function list($tbl) {
extract(shortcode_atts(array('item' => '')), $tbl);
if($tbl["item"]!="") {
$mydb= new wpdb('root','root','mydb','localhost');
$rows = $mydb->get_results("select * from ".$tbl["item"].";",ARRAY_N);
echo "<table>";
for($i=0;$i<count($rows);$i++) {
echo "<tr>";
for($j=0;$j<count($rows[$i]);$j++) {
echo "<td>".$rows[$i][$j]."</td>";
}
echo "</tr>";
}
echo "</table>";
} else {
echo "<h2>blank attr</h2>";
}
}
If someone has a better answer please share!
:D