yamot47 0 Light Poster
echo("<TABLE width='70%' border='2' cellpadding='3' ALIGN=CENTER   name='test' >");
 
        echo("<TR bgcolor='B0C4DE'>"); 
        echo("<TH>Sr.No</TH>");
        echo("<TH>Title Of Book</TH>");
        echo("<TH>Author Name</TH>");
        echo("<TH>Number of Copies</TH>");
		echo("<TH>Borrow</TH>");
		echo("</TR>"); 
 
	//searching using title of book
	$count=0;  $i=1; 		while ($row = mysql_fetch_assoc($query)){ 
 
        echo("<TR   id='$i'  bgcolor='B0C4DE'>"); 
	    $sr_num=$row['b_sr_num'];
		echo ("<td><input name=data id=data type=text id=data readonly=readonly  value=$sr_num></td>");
		echo ('<td>'.$row['b_name'].'</td>');
		echo ('<td>'.$row['b_author'].'</td>');
		echo ('<td>'.$row['b_avail'].'</td>');
 
		if($row['b_avail']>0)
		{
				if (!$_SESSION["valid_user"])
        {
        // User not logged in, redirect to login page
		echo("<td>Available</td>");
		}else
echo("<td><INPUT TYPE=button  id=show  name=show value=add onClick= buttonPress('$sr_num')></td>");
 
		}else
		echo("<td>No stock of book</td>");
		echo("</TR>"); 
		  $i=$i+1;  }	  
echo("</TABLE>"); 
 
 
		echo("<DIV ALIGN=CENTER><INPUT TYPE=SUBMIT NAME=Next VALUE=Next>");
	    echo("<INPUT TYPE=SUBMIT NAME=Previous VALUE=Previous></DIV>");
		echo("</FORM>");
 
} 
} 
}

how can i get the value of the rows?? if i want to get the value of the first column??and when i clicked the button it will diplay what row i click and get the value of sr_num??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.