0

hi there i am newbee in PHP and i need some help, how can i user the elements stored in my database for my navigation bar??

<?php
$keyword=$_POST['keyword'];

$con=mysql_connect("localhost","root");
        if(!$con)
        {
            die("could not connect");
        }
        mysql_select_db('cms') or die("could not select db");

        $sql= "select value from cms where keyword='$keyword'";
        $result =mysql_query($sql);

            if(!$result)
                {
                    echo "sql not successfully run";
                }
                    if(mysql_num_rows($result)==0)
                    {
                        echo "no rows available";
                        exit;
                    }
                        while($row=mysql_fetch_assoc($result))
                        {
                        echo '<a href="">'. $row['value']. '</a>';

                        }
        mysql_free_result($result);
?>

i just select it, how can I categorize them on the navigation??

example:
In my database I stored,
Home,Profile,FAQ

how can i call them one by one??

Edited by Nick Evan: Fixed formatting

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by urtrivedi
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.