Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to solve this... i want to make a detail viewing information from database to my website that i refer it from a primary key that i want to view it which mean id....

i want to make a a href coding that i clicked the id which mean some of my primary key from database and header it to detail.php mean that i want to view the rest of information for this project is student information but want i create a code i there nothing appeare at the screen

i use sublime and xampp

What I have tried:

<?php include('dbp.php'); ?>
<!DOCTYPE html>
<html>
<head>
	<title>Student List</title>
</head>
<body>		
	<?php if (isset($_SESSION['message'])): ?>
		<div class="msg">
			<?php 
				echo $_SESSION['message']; 
				unset($_SESSION['message']);
			?>
		</div>
	<?php endif ?>


	
	<table class="blueTable">
		<tr>
			<th>id</th>
			<th>name</th>
			<th>class</th>
			<th colspan="2"></th>
		</tr>

		<?php while ($row = mysqli_fetch_array($results)) { ?>
			<tr>
				<td><a href="detail.php?id=<?php echo $id; ?>"><?php 
                                    echo $row['id']; ?></a></td>
				<td><?php echo $row['name']; ?></td>
				<td><?php echo $row['class']; ?></td>
				<td>
					<a href="signupstudent.php?edit=<?php echo 
                                           $row['id']; ?>" class="edit_btn" >Edit</a>
					<a href="dbp.php?del=<?php echo $row['id']; ? 
                                           >" class="del_btn">Delete</a>
				</td>
        <td>
          <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
          <label>
          <input type="file" name="file" id="file" />
          <input type="submit" name="btn_uploadpic" id="btn_uploadpic" value="Upload Pic" />
          </label>
                          <input name="hf_name" type="hidden" id="hf_name" value="<?php echo $row['name']; ?>" />
          </form>      
        </td>
        <td><img src="upload/<?php echo $row['name']; ?>.jpg" width="67" height="81" /></td>
			</tr>
		<?php } ?>
	</table>
<a href="home.php">Home</a>

</body>
</html>
Posted
Updated 4-May-18 7:25am
v3

1 solution

I don't see your query to know what you expect in $results

Do you know that you've any data to show at all?

Further help: when you get the 'blank page', you should be able to view its source (that is, what's on the page). In FireFox, for example, you right click on the page and then select "view page source". Now you can see what, if anything, came back. It may be that it will show you an error message that's not rendered on your screen (for example, from a failed TSQL query).

Other error may also be made visible, such as undefined index(s).

Your first task is to see if you even get data back in order to display on the page.
 
Share this answer
 
Comments
Member 13756050 5-May-18 5:38am    
Yes i know that but in this case i want to retrive a specific contains of my primary key in database to the rest information that contains in database but i dont know to create it.
W Balboos, GHB 7-May-18 6:22am    
Don't know how to create what? A key? At table? The query to use a key?

SO far, your error description is a 'blank page'. How is anyone supposed to help you with that error? It's your code on your computer - so find out the error.

.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900