output the result of a query of a database?
<p>Hello i got a problem with my mysql code it gives the following error upon trying to output:</p>

<pre><code>Parse error: syntax error, unexpected $end in     C:\xampplite\htdocs\learncent\acksearch\search.php on line 25 
</code></pre>

<p><br /></p>

<pre><code>&lt;?php
$db = new mysqli("localhost","root","","acksocial");

if(mysqli_connect_error())
{
printf("Connection failed:%s \n",mysqli_connect_error());
exit();
}

$name = mysqli_real_escape_string($db, $_POST['search']);
$table = 'acksearch';

if($result = $db-&gt;query("SELECT * FROM $table WHERE name = $name", MYSQLI_ASSOC))
{
    while($row = $result-&gt;fetch_object())
    {

    // $row is an associative array

    // Do something here

echo "Name: ".$row['name'];

echo " country: ".$row['country'];


}

$db-&gt;close();
?&gt;
</code></pre>

<p>EDIT: 
added 1 more } and no error but it wont output the result?</p>

<p>Would be good if anyone could help me.</p>

<p>EDIT AGAIN : Now  the code look like this</p>

<pre><code>&lt;?php
$db = new mysqli("localhost","root","","acksocial");

if(mysqli_connect_error())
{
printf("Connection failed:%s \n",mysqli_connect_error());
exit();
}

$name = mysqli_real_escape_string($db, $_POST['search']);
$table = 'acksearch';

if($result = $db-&gt;query("SELECT * FROM $table WHERE name = $name", MYSQLI_ASSOC))
{
while($row = $result-&gt;fetch_object())
{

// $row is an associative array

// Do something here

echo "Name: ".$row['name'];

echo " country: ".$row['country'];

}
</code></pre>

<p>The error its giving its:</p>

<pre><code>Parse error: syntax error, unexpected $end in C:\xampplite\htdocs\searcher.php on line 25
</code></pre>

<p>Thanks Fredrik</p>
