dynamic link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mushfiq
    New Member
    • Nov 2008
    • 5

    dynamic link

    hello...

    i want to display the data from mysql database & simultaneously make each data a link passing the id.

    Code:
       <?php
           mysql_connect("localhost", "root", "");
       mysql_select_db("form");
    	  $result=mysql_query("select name from dynamic") or  die(mysql_error()); 
    	  
    	  if(mysql_num_rows($result)==0)
    	   {
    	    echo "database is empty <br>";
    	   }  else 
    	    {
    		 while(list($id,$name)=mysql_fetch_array($result))
    		  {
    		?>
    		<a href="dynamic2.php?id=$id?"> <?php echo $uname; ?>  </a> <br >
    		<?php
    		} 
    		
    ?>
    can anyone say what is wrong with it??if u can,plz help me...
    regards.....
    Last edited by Markus; Nov 9 '08, 09:17 PM. Reason: added # tags
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Hi, Mushfiq. Welcome to the forums.

    A few points first:
    • Use code tags when you post code. Read the posting guidelines.
    • "Can anyone say what is wrong with it" To be helpful, you could help us. Tell us what does happen. What doesn't happen. What errors you get.
    • Excessive use of punctuation is frowned upon - using more than one question mark doesn't get you an answer any faster.
    • "Plz" is spelled "Please".


    Please pay attention to the above.

    In your mysql_query() you select 'name'. If you are to use ID too, you need to select that from the Database.

    Comment

    Working...