Jump to content

Help With Repeating Table!


Krelle

Recommended Posts

Me and my friends have started a little winetasterclub, and so I volunteered for creating a website. I have absolutely no education in creating websites and have learned some basic html and php on the go.

About a month ago we switch to wordpress and it has been going fine until now. I got a friend, who has an education in web design, and he has looked at my problem, and he cant see the error, so i turn to you now :happy-04:

 

My problem is this: http://www.vinklubben-tyggesvin.dk/vin/mousserende-vin/

 

As you can see the first row is repeating itself after it has printed the result.

 

the code:

$db_selected = mysql_select_db("Vin", $con);

 

$result = mysql_query("SELECT * FROM wp_pods_vine

WHERE vintype='Champagne'");

 

echo "<table border='1'>

<tr>

<td>Navn</td>

<td>Årgang</td>

<td>Land</td>

<td>Vintype</td>

<td>Point</td>

</tr>";

 

while($row = mysql_fetch_array($result))

{

echo "<tr>";

echo "<td><a href=".$row['permalink'].">" . $row['name'] . "</a></td>";

echo "<td>" . $row['aargang'] . "</td>";

echo "<td>" . $row['land'] . "</td>";

echo "<td>" . $row['vintype'] . "</td>";

echo "<td>" . $row['point'] . "</td>";

echo "</tr>";

}

echo "</table>";

 

mysql_close($con);

 

I am using a plugin called pods and this code is a template that i am using.

 

Any help would be great since I have promise my friends that the new website would be done before the new year. :tease-01:

Link to comment
Share on other sites

You also have some charset issues there, I see. I assume this is because you haven't selected the proper charset for the MySQL connection, which you can do with mysql_set_charset ().

 

Also, take the above SQL query, and run it manually against the DB. Should hopefully give you some more information on why this is happening, or at the very least cross out one of the potential causes.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.