Jump to content

grid view problem


jaiffed

Recommended Posts

hello...

 

i have this script ....

 

mysql_select_db($Db, $link);     

 

$query="select * from mem_master where mem_id=$q";

 

$result= mysql_query($query,$link) or die(""); 

 

$fel=mysql_num_fields($result);

$nro=mysql_num_rows($result);

 

 

if($nro>0)

{

 

 

  $row=mysql_fetch_array($result);

  echo '<table border="2">';

  echo '<tr>';

  echo "<tdcolspan='2'>" . $row['mem_name'] . "</td>";

  echo '</tr>';

  echo '<tr>';

  echo "<td>" . "Balance : " . "</td>";

  echo "<td>" . $row['balance'] . "</td>";

  echo '</tr>';

 

echo '</table>';

   

}

it makes grid view of member name and balance like this in html table:-

..........................................................................................

Member ID          |Member Name            |Balance            |

...........................|...................................|.........................|

101                    |Andy                          |600                  |

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

102                    |Anne                          |800                  |

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

103                    |Ronnie                        |1200                |

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

 

now i want that when user click on member id or name then the value of member id come in variable $mem

it is possible please help.........

Link to comment
https://forums.phpfreaks.com/topic/192363-grid-view-problem/
Share on other sites

Change output of the member id and/or member name to be a hyperlink anchor.

Also pass the value of member id via GET method in the URL of the href attribute: <a href="handlingScript.php?mem=$row['mem_id']">$row['mem_name']</a>

 

where handlingScript.php is the file that will be loaded when the user clicks the link. value of $row['mem_id'] will be passed in $_GET['mem']

 

Link to comment
https://forums.phpfreaks.com/topic/192363-grid-view-problem/#findComment-1013626
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.