passing dynamic content

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
juice
Forum Newbie
Posts: 12
Joined: Tue Feb 01, 2005 9:50 am

passing dynamic content

Post by juice »

I have a page which displays all members with a select link beside all members usernames.if i click on select link beside a member it should display the members details.however when it goes onto next page it says no rows selected.
First page is memberdisplayfname and displays all members with link beside them:

Code: Select all

<table border="" cellpadding="0" cellspacing="1" style="border-collapse: collapse; border-width: 0" bordercolor="" width="100%" id="AutoNumber6">
            <!--DWLayoutTable-->
            
            <tr>
              <td width="111" height="44" valign="top"><? echo $row["username"]; ?></td>
              <td width="159" valign="top"><? echo $row["lname"]; ?></td>
              <td width="124" valign="top"><? echo $row["fname"]; ?></td>
            <td width="52" valign="top" bgcolor="#9999FF"><a href= "testlinksession.php?username= ', $row['username'],'">Select</a> </td> 
            </tr>


Second page is testlinksession and should display the selected members details:

<?
include "db_connection.php";
$connect = db_connect();
//$username = $row['username'];
//$username = $_GET['username']; 
if ($connect)
//$_SESSION['username'] = $username;
{
$query = "select * from member Where username = '$username'"; //Selecting all Entries from the database

	$result = mysql_query($query,$connect); //Assigns the variable result to the Query Connection
	
	$temp = mysql_fetch_array($result);
			
	if(mysql_num_rows($result)==0)
	{
	
	echo"No Rows";
	
	}
	
	while($row = mysql_fetch_assoc($result)) //;
	{
	  ?>
	  
	
	
      <table border="" cellpadding="3" cellspacing="1" style="border-collapse: collapse; border-width: 0" bordercolor="" width="100%" id="AutoNumber6">
            <!--DWLayoutTable-->
            
            <tr>
              <td width="109" height="27" valign="top"><? echo $row["lname"]; ?></td>
              <td width="101" valign="top"><? echo $row["fname"]; ?></td>
              <td width="187" valign="top"><? echo $row["street"]; ?></td>
              <td width="114" valign="top"><? echo $row["city"]; ?></td>
              <td width="116" valign="top"><? echo $row["county"]; ?></td>
              <td width="190" valign="top"><? echo $row["email"]; ?>
Any help would be grateful

PHENOM | please review Posting Code in the Forums first :!:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

note how line 8 isn't highlighted with php code.
juice
Forum Newbie
Posts: 12
Joined: Tue Feb 01, 2005 9:50 am

Post by juice »

If put the a link tag inside php quotes i get mistake. You cudnt put <a href iside php can you.

im getting no rows selected on the next page. its not taking in the username for some reason
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

php tags in html works - any html tag
Line 8:

Code: Select all

<td width="52" valign="top" bgcolor="#9999FF">
<a href= "testlinksession.php?username=<? echo $row['username']; ?>">Select</a>
</td>
Post Reply