Loading ...
Sorry, an error occurred while loading the content.

Re: [phpXperts] php db prob....connecting link with the display text with my database

Expand Messages
  • supankar banik
    Hi, I have checked your code and found one thing. May be your desired table ek has only one row if there is no syntax error. Please look at your code. You
    Message 1 of 7 , May 18, 2010
    • 0 Attachment
      Hi,

      I have checked your code and found one thing. May be your desired table "ek" has only one row if there is no syntax error. Please look at your code. You have already fetched the first row using the code "$myrow = mysql_fetch_array($result1);" but when you have  to try to fetch the array again using "while ($myrow = mysql_fetch_array($result1))"  then the first row not shown because you have already fetch it earlier. If your database has only one row then while loop doesn't work. Does it make sense?

      Regards;
      Supankar


      From: Mridul <mri_roy@...>
      To: phpexperts@yahoogroups.com
      Sent: Tue, May 18, 2010 5:29:19 AM
      Subject: [phpXperts] php db prob....connecting link with the display text with my database

       

      for a long day i stacked in that...i can't find my fault in that code.....register globals are on ....plz any one help...

      > my code

      <?php
      include ('connect_db.php');

      $table ="ek";

      $result1= mysql_query("SELECT * FROM $table ");

      $myrow = mysql_fetch_array($result1);

      while ($myrow = mysql_fetch_array($result1)) {

      $title = $myrow["user_user"];

      echo '<a href="' . $_SERVER['PHP_SELF'] . '?username=' . $myrow['user_user'] . '">' . $title . '</a>';
      }

      ?>

      > but in output it doesn't show anything even not a error....plz any body help..


    Your message has been successfully submitted and would be delivered to recipients shortly.