problem with code

Alles, was PHP betrifft, kann hier besprochen werden.

problem with code

Postby Ladydee » 26. February 2009 02:51

I am trying to et the name and email address from MySql. Part of this is working, I am getting the emall address but not the name.
Here is the code I am using:

Code: Select all
<?php
   
      $sql = "select * from subscribers";

   $result = mysql_query($sql);
   $num_rows=mysql_num_rows($result);
   echo "<div align=right class=FormTitle>Total No. of Customers : " . $num_rows."</div>";
   $sno = 0;
$noofrecord = mysql_num_rows($result);
if ($start == "" && $end == "")
{
   $start = 1;
   $end = 20;
}

   while($row=mysql_fetch_array($result))
   {
   if ($id == $end)
   {
break;
   }
     
    $id++;
   
    $id = $row["id"];
    $email = $row["email"];
   $name = $row["name"];
   
   

echo "<tr class=TableFields><td>$email<td>$name</td>";
echo "<td class=LinkText align=center><a href=newsmailerlist.php?action=2&email=$email>Edit</a></td>";
echo "<td class=LinkText align=center><a href=newsmailerlist.php?action=3&email=$email>Delete</a></td>";

}
   
?>


Can someone tell me what I need to change or add to make this work?

Thank you Ladydee
Ladydee
 
Posts: 17
Joined: 19. February 2009 14:38

Re: problem with code

Postby KingCrunch » 28. March 2009 03:16

What you get instead of "name"? Try vardump($row);
Nicht jeder Fehler ist ein Bug ...
KingCrunch
 
Posts: 1724
Joined: 26. November 2005 19:25


Return to PHP

Who is online

Users browsing this forum: No registered users and 53 guests