insert echo into the specific html element like div which has an id or class
<p>I have this code.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;style type="text/css"&gt;
body{background:#666666;}
div{border:1px solid red;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?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 '&lt;img src="'.$row['name'].'" /&gt;';  
echo "&lt;div&gt;".$row['name']."&lt;/div&gt;";
echo "&lt;div&gt;".$row['title']."&lt;/div&gt;";
echo "&lt;div&gt;".$row['description']."&lt;/div&gt;";
echo "&lt;div&gt;".$row['link']."&lt;/div&gt;";
echo "&lt;br /&gt;";
}

mysql_close($con);

?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>the above code works.</p>

<p>now, I want to insert this</p>

<pre><code>echo '&lt;img src="'.$row['name'].'" /&gt;'; 
echo "&lt;div&gt;".$row['name']."&lt;/div&gt;";
echo "&lt;div&gt;".$row['title']."&lt;/div&gt;";
echo "&lt;div&gt;".$row['description']."&lt;/div&gt;";
echo "&lt;div&gt;".$row['link']."&lt;/div&gt;";
echo "&lt;br /&gt;";
</code></pre>

<p>into the specified div or other element in the html, example, i will insert this</p>

<pre><code>echo '&lt;img src="'.$row['name'].'" /&gt;';
</code></pre>

<p>into the html element .</p>

<p>I dont know how to do this, please help me. Thanks</p>

<p>Juliver</p>
