尝试访问数据库并显示位于电影表中的 imageurl 的内容似乎不起作用。有什么建议么?
<?php
//connect to DB
$db = mysqli_connect("localhost", "awalke32", "21195453", "awalke32");
if (mysqli_connect_errno($db)) {
print "Connect failed: " . mysqli_connect_error();
exit();
} else {
$myint = rand("1", "37"); //random number gererator
$query = ("SELECT imageurl FROM movie WHERE movie_id=" . $myint); //think the error is in here but it works in Terminal secure shell
$result = mysql_query($query);
print "<table width=\"100%\"><tr>";
print "<td align=\"center\">";
print "<img src='images/" . $result . "' alt='Image'>"; //this is correct as it works in another page
print "</td>";
print "</td></tr></table>";
}
?>