Page 1 of 1

What's wrong with this code?

Posted: Thu Sep 24, 2009 8:58 pm
by rozkan

Code: Select all

               <td id="navigation">
                <?php
                //Veritaban? sorgulamas?.
                $result = mysql_query("SELECT * FROM konular", $connection);
                if(!$result) {
                    die("Veritaban? sorgulamas? ba?ar?s?z" . mysql_error());
                }
                //Sorgu verisini kullan.
                while ($row = mysql_fetch_array($result)) {
                    echo $row["menu_adi"]." ".$row["pozisyon"]."<br />";
                }
                ?>
                </td>
Hello, i am a newbie and building my first CMS however this part of code isn't working properly, when i try to open the page it opens and everything ok but nothing inside "navigation" sidebar. It doesn't give any error but nothing on the menu too? Table "konular" and fields in the code exist in MySQL database. Any help apprecitaed, thanks...

Re: What's wrong with this code?

Posted: Thu Sep 24, 2009 9:29 pm
by Griven
It's never too early to be introduced to the debugging process!

The code you have about is (as far as I can see) correct. I would check to see that your $connection code is also correct. Also, place some plain text directly after the navigation PHP code to see if there is something breaking the page within or before the code.

Re: What's wrong with this code?

Posted: Fri Sep 25, 2009 2:11 am
by rozkan
Thanks, i actually solved the problem.:)