Team,
Again, forgive me in my ignorance. With help from some of you, I have successfully created a form that inputs into the mysql database, and a page that displays the 50 most recent entries.
What I am needing is a way for a user to click a “View” button and have the data for that particular row displayed on an HTML page. I am aware I need to create the page.
What I am lost on is how to create this button for each row, and how this button will carry over the specific record’s data to the HTML page.
Each entry has a unique “ID” which is AI.
Code for my page is below:
[php]<?php
{ // Secure Connection Script
include(’…/htconfig/dbConfig.php’);
$tbl_name=“members”; // Table name
// Connect to server and select databse.
mysql_connect("$hostname","$username","$password");
mysql_select_db("$database")or die(“cannot select DB”);
// username and password sent from form
$myusername=$_POST[‘myusername’];
$mypassword=$_POST[‘mypassword’];
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql=“SELECT * FROM $tbl_name WHERE username=’$myusername’ and password=’$mypassword’”;
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file “login_success.php”
session_register(“myusername”);
session_register(“mypassword”);
?>
<?php $table = 'POs'; if (!mysql_select_db($database)) // sending query $fields_num = mysql_num_fields($result);
|