Krelle Posted December 30, 2012 Share Posted December 30, 2012 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 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. Quote Link to comment https://forums.phpfreaks.com/topic/272517-help-with-repeating-table/ Share on other sites More sharing options...
Barand Posted December 30, 2012 Share Posted December 30, 2012 (edited) I can't see any reason in the code posted. Have you checked there isn't a duplicated row in the database table? edit PS Don't panic, you still have 35.5 hours Edited December 30, 2012 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/272517-help-with-repeating-table/#findComment-1402186 Share on other sites More sharing options...
Krelle Posted December 30, 2012 Author Share Posted December 30, 2012 Thank you for the reply! Since it isn't the code, there is something wrong with, maybe it is the plugin then. Hopefully I will get a reply from the developers before 35.5 hours! Quote Link to comment https://forums.phpfreaks.com/topic/272517-help-with-repeating-table/#findComment-1402194 Share on other sites More sharing options...
Christian F. Posted December 30, 2012 Share Posted December 30, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/272517-help-with-repeating-table/#findComment-1402220 Share on other sites More sharing options...
jcbones Posted December 30, 2012 Share Posted December 30, 2012 The repeating code isn't coming from the database. I would look at the plug in, or how the template is called. Quote Link to comment https://forums.phpfreaks.com/topic/272517-help-with-repeating-table/#findComment-1402221 Share on other sites More sharing options...
Krelle Posted January 2, 2013 Author Share Posted January 2, 2013 Turns out it was my inexperience with the plug-in and the problem is solved Thank you for the replies! Quote Link to comment https://forums.phpfreaks.com/topic/272517-help-with-repeating-table/#findComment-1402785 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.