What's wrong with this code?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rozkan
Forum Newbie
Posts: 10
Joined: Thu Jul 02, 2009 8:08 pm

What's wrong with this code?

Post 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...
Griven
Forum Contributor
Posts: 165
Joined: Sat May 09, 2009 8:23 pm

Re: What's wrong with this code?

Post 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.
rozkan
Forum Newbie
Posts: 10
Joined: Thu Jul 02, 2009 8:08 pm

Re: What's wrong with this code?

Post by rozkan »

Thanks, i actually solved the problem.:)
Post Reply