First, you are including your db connection info, which is bad. But you don't include the database you're connecting to.
You need to read more about how to do forms. You don't even have any form tags, unless you left them out on purpose?
You also have php and html mixed right in with each other, which will only give you errors.
Then, you don't say what $x is, not sure if it really matters.
It all should look something like this:
CODE
<?php
$roll = $_POST['roll'];
mysql_connect('localhost', 'username', 'password');
mysql_select_db('database');
$result = mysql_query("SELECT * FROM student WHERE roll_no = $roll");
$row = mysql_fetch_assoc($result);
$contents = $row['contents'];
?>
<form method="post">
Roll No: <input type="text" name="roll" value="<?php echo $roll; ?>">
<input type="submit" name="submit" value="Submit">
</form>
This post has been edited by Styx: 14 Jul, 2007 - 07:10 AM