How to select relevant user from php table

I’m trying to display relevant user details when click after user details button.it is css pop up window.i want to know how to catch relevant user when click the button.my primary key is email.


<?

	$connect = mysql_connect("localhost","root","");	
	if(!$connect){echo("<script>alert('DBMS connection error');</script>>");}	
	if(!mysql_select_db("biz", $connect)){echo("<script>alert('Unable to find DB');</script>>");}	
	
	$result1 = mysql_query("SELECT radio,yname,mail,cpw,tp,city FROM reg WHERE mail='SSS@SSS.SS'");
	$row1 = mysql_fetch_assoc($result1);
	mysql_close($connect);

?>


<form class="form-signin" role="form">
Name : <?php echo $row1['yname'] ?>
Telephone no :
</form>

this is what i did.it’s display same name to deferent users.

please help.

Can you show the code where you get the email address to use for the search? All I see is a query where you’ve hard-coded the email address to search for, which of course will always return the same record.

Also read the sticky post at the top of the forum about why you need to stop using mysql functions and use PDO (or mysqli ) instead.

This is admin panel function(manage users).Every registered users names are display in this table.When click this show button it’s open pop-up.i want to display all the user details in this pop-up.

–this is my php table –


$connect = mysql_connect("localhost","root","");
if(!$connect){echo("<script>alert('DBMS connection error');</script>");}
if(!mysql_select_db("biz", $connect)){echo("<script>alert('Unable to find DB');</script>>");}
echo "test";
$result = mysql_query("SELECT yname FROM reg");

mysql_close($connect);

while($row=mysql_fetch_array($result))
{
echo '<tr class="odd gradeX">
<td>'.$row["yname"].'</td>
<td><input type="image" src="images/view.png" width="40" height="40"   name="view" id="view"  class="center" data-toggle="modal" value="show" data-target="#signin1"/></td>

</tr>';
}
echo '</table>';

 

this is user details pop-up…


$connect = mysql_connect("localhost","root","");
if(!$connect){echo("<script>alert('DBMS connection error');</script>>");}
if(!mysql_select_db("biz", $connect)){echo("<script>alert('Unable to find DB');</script>>");}

$result1 = mysql_query("SELECT radio,yname,mail,cpw,tp,city FROM reg WHERE mail='SSS@SSS.SS'");
$row1 = mysql_fetch_assoc($result1);
mysql_close($connect);

<form id=“form1”>
User Type :Business
Name :<?php echo $row1[‘yname’] ?>
Email Address :abc@gmail.com
Password :xxxxxx

</form>
(only name come from DB.others are still hard code).please help

Your first bit of code that produces the table only returns the ‘yname’ column, so you’ll need to change that to also return the ‘email’ column. Then you’ll need to pass that to your second bit of code to use in the select statement there.

I am not familiar with how your pop-up works or how you even call it from your first bit of code, someone else will hopefully be along to help out there.