我有这个代码.
<html> <head> <style type="text/css"> body{background:#666666;} div{border:1px solid red;} </style> </head> <body> <?PHP $con = MysqL_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . MysqL_error()); } MysqL_select_db("juliver",$con); $result = MysqL_query("SELECT * FROM hi"); while($row = MysqL_fetch_array($result)) { echo '<img src="'.$row['name'].'" />'; echo "<div>".$row['name']."</div>"; echo "<div>".$row['title']."</div>"; echo "<div>".$row['description']."</div>"; echo "<div>".$row['link']."</div>"; echo "<br />"; } MysqL_close($con); ?> </body> </html>
上面的代码工作.
现在,我想插入这个
echo '<img src="'.$row['name'].'" />'; echo "<div>".$row['name']."</div>"; echo "<div>".$row['title']."</div>"; echo "<div>".$row['description']."</div>"; echo "<div>".$row['link']."</div>"; echo "<br />";
在html中指定的div或其他元素,例如,我将插入这个
echo '<img src="'.$row['name'].'" />';
进入html元素.
我不知道该怎么做,请帮助我.谢谢
Juliver