Jump to content

[SOLVED] Exam Results script. Please help me ..........


ankur0101

Recommended Posts

Hi friends,

I am new in PHP MySQL.

I am making one script of php exam results.

 

I have following pages

 

register.php

search.php

showresult.php

 

Register.php - > A form where marks will be entered in database.

I have done that.

 

Search.php -> A search box with "Search" button where students will enter their roll number.

showresult.php - > A page where results will be displayed according to the roll number entered in search.php page.

 

The page showresult.php should work as follows .....

showresult.php?id=56

 

That means this will show the result of that student who's roll number is 56

,,

How can i do that ?

 

Link to comment
Share on other sites

Hi Ankur0101,

 

Something like:

 

search.php

<?php
$dbHost = "localhost";
$dbUser = "USERNAME";
$dbPass = "PASSWORD";
$dbname = "DBNAME";	
$db = mysql_connect($dbHost,$dbUser,$dbPass);
mysql_select_db($dbname,$db);

if(isset($_POST['submit'])) {
$rID = $_POST['rID'];

$sql1 = mysql_query("SELECT rID FROM tblresults WHERE rID = $rID");
$row1 = mysql_num_rows($sql1);

if($row1 == 0) {
	echo 'Error, ID does not exist';
} else {
	header('Location: showresult.php?rID='.$rID);
}	
}
?>

<html>
<head>
<title>Search</title>
</head>
<body>

<form action="search.php" method="post">
<input type="text" name="rID" />
<input type="submit" name="submit" value="search" />
</form>
</body>
</html>

 

showresult.php

<?php
$dbHost = "localhost";
$dbUser = "USERNAME";
$dbPass = "PASSWORD";
$dbname = "DBNAME";	
$db = mysql_connect($dbHost,$dbUser,$dbPass);
mysql_select_db($dbname,$db);

$rID = $_GET['rID'];

$sql1 = mysql_query("SELECT * FROM tblresults WHERE rID = $rID");
$row1 = mysql_fetch_array($sql1);
$exam1 = $row1['exam1'];
$exam2 = $row1['exam2'];
?>

<html>
<head>
<title>Show Results</title>
</head>
<body>

<?php
echo 'Exam 1 = '.$exam1.'<br />
Exam 2 = '.$exam2;
?>

</body>
</html>

 

Hope this helps,

 

John

Link to comment
Share on other sites

Hello John Sir,

Its working fine but 1 error

 

Error in search.php

I am using Dreamweaver 8

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\phpresult\search.php:2) in D:\xampp\htdocs\phpresult\search.php on line 19

 

I am using show_result.php instead of showresult.php

So i modified my code

 

if(isset($_POST['submit'])) {

  $roll_no = $_POST['roll_no'];

 

  $sql1 = mysql_query("SELECT roll_no FROM result_table WHERE roll_no = $roll_no");

  $row1 = mysql_num_rows($sql1);

 

  if($row1 == 0) {

      echo 'Error, ID does not exist';

  } else {

      header('Location: show_result.php?roll_no='.$roll_no);

 

But show_result.php is working fine.

Link to comment
Share on other sites

Code of search.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
$hostname_php_result_conn = "localhost";
$database_php_result_conn = "phpresult";
$username_php_result_conn = "root";
$password_php_result_conn = "demoxampp";   
$php_result_conn = mysql_connect($hostname_php_result_conn, $username_php_result_conn, $password_php_result_conn);
mysql_select_db($database_php_result_conn,$php_result_conn);

if(isset($_POST['submit'])) {
   $roll_no = $_POST['roll_no'];
   
   $sql1 = mysql_query("SELECT roll_no FROM result_table WHERE roll_no = $roll_no");
   $row1 = mysql_num_rows($sql1);
   
   if($row1 == 0) {
      echo 'Error, ID does not exist';
   } else {
      header('Location: show_result.php?roll_no='.$roll_no);
   }   
}
?>

<html>
<head>
<title>Search</title>
</head>
<body>

<form action="search.php" method="post">
<input name="roll_no" type="text" id="roll_no" />
<input type="submit" name="submit" value="search" />
</form>
</body>
</html>

 

Code of show_result.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
$hostname_php_result_conn = "localhost";
$database_php_result_conn = "phpresult";
$username_php_result_conn = "root";
$password_php_result_conn = "demoxampp";   
$php_result_conn = mysql_connect($hostname_php_result_conn, $username_php_result_conn, $password_php_result_conn);
mysql_select_db($database_php_result_conn,$php_result_conn);

$roll_no = $_GET['roll_no'];

$sql1 = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_no");
$row1 = mysql_fetch_array($sql1);
$name = $row1['name'];
$marks = $row1['marks'];
?>

<html>
<head>
<title>Show Results</title>
</head>
<body>

<?php
echo 'Name = '.$name.'<br />
Marks = '.$marks;
?>

</body>
</html>

 

 

That's it...

Link to comment
Share on other sites

you have that doctype line at the top of your script but later on in your script you call header() based on some condition.  Well if condition evaluates true, you get the error, because any output causes headers to be sent.  I suggest you move the doctype tag down to where the rest of your html is.  And make sure you remove the line completely, not just the code.  No output can be sent, not even whitespace, before header();

Link to comment
Share on other sites

Yes and 1 more question,

Suppose i have only 5 students data that means 1,2,3,4,5 roll no.s are only stored in database.

When i type  show_result?roll_no=8 ( Roll No. 8 doesn't exist in database )

 

Its shows me page with only

Name =

Marks =

 

I want to do it as there should an error with text "Invalid Roll No."

 

What i have to do for that ?

Link to comment
Share on other sites

Your search.php already does that.  If no rows are returned, you have

 

echo 'Error, ID does not exist';

 

Otherwise, it sends you to show_result.php.  Since your show_result.php just takes the GET var and does a query based on that value, there's nothing to stop someont from directly going to show_result.php.  So you have a couple of options. You can...

 

a) Do the same thing in show_result.php as you did in search.php (run the query and if num_rows == 0, give error message).  This isn't really that great of an option, as it's in essence duplicating code.  That is, why bother with search.php at all, if you're just going to turn around and do the same thing again, in show_result.php?

 

b) Put a condition in show_result.php to kick the user back to search.php if the referring page is not search.php

<?php
  if ($_SERVER['HTTP_REFERER'] != 'search.php') {
     header("Location: search.php"); exit;
  }
  // rest of code here
?>

Slightly better option, but personally, I'd go for option c.

 

c) Combine search.php and show_result.php into a single script. 

Link to comment
Share on other sites

If you want single page try this

 

<?php
$hostname_php_result_conn = "localhost";
$database_php_result_conn = "phpresult";
$username_php_result_conn = "root";
$password_php_result_conn = "demoxampp";   
$php_result_conn = mysql_connect($hostname_php_result_conn, $username_php_result_conn, $password_php_result_conn);
mysql_select_db($database_php_result_conn,$php_result_conn);

if(isset($_POST['submit'])) {
   $roll_no = $_POST['roll_no'];
   
   $sql1 = mysql_query("SELECT roll_no FROM result_table WHERE roll_no = $roll_no");
   $row1 = mysql_num_rows($sql1);
   
   if($row1 == 0) {
      echo 'Error, ID does not exist';
   } else {

$sql1 = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_no");
$row1 = mysql_fetch_array($sql1);
$name = $row1['name'];
$marks = $row1['marks'];

echo 'Name = '.$name.'<br />
Marks = '.$marks;

   }   
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Search</title>
</head>
<body>

<form action="search.php" method="post">
<input name="roll_no" type="text" id="roll_no" />
<input type="submit" name="submit" value="search" />
</form>
</body>
</html>

<?php
}
?>

Link to comment
Share on other sites

Here you go Use This Code for The Page search.php

 

(This Is Made to Be its own Page)

 

Here is a working example

 

http://1800sexnow.com/demos/search/search.php

 

<?php
error_reporting(E_ALL);

$hostname_php_result_conn = "localhost";
$database_php_result_conn = "sex1800_phpresults";
$username_php_result_conn = "sex1800_demo";
$password_php_result_conn = "demotable";   
$php_result_conn = mysql_connect($hostname_php_result_conn, $username_php_result_conn, $password_php_result_conn);
mysql_select_db($database_php_result_conn,$php_result_conn);

if(isset($_POST['submit'])) {
   $roll_no = $_POST['roll_no'];
   
   $sql = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_no") or die (mysql_error());
$row1 = mysql_fetch_array($sql);
$name = $row1['name'];
$marks = $row1['marks'];
   
   if($row1 == 0) {
      echo 'Error, ID does not exist';
   } else {

echo 'Name = '.$name.'<br />
Marks = '.$marks;

   }   
} else {
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false;}
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(roll_no,"You Must type In a Role Number")==false)
  {roll_no.focus();return false;}
}
}
</script>

<style type="text/css">
#header { width:100%;
background:lightblue;
margin:0px;
padding:0px;
}

#leftbar { float:left;
width:40%;
height:30px;
background:lightblue;
text-align:right;
}

#rightbar { float:left;
width:60%;
height:30px;
background:lightblue;
text-align:center;
}

#bar { width:100%;
background:lightblue;
}

#center {float:center;
width:60%;
height:10px;
background:lightblue;
align:center;
}

a { font-family:Arial;
font-size:16px;
background-color:aqua;
color:blue;
font-weight:bold;
vertical-align:text-bottom;
}

a:hover { font-family:Lucida Calligraphy;
font-size:ahoversize1;
background-color:yellow;
color:darkblue;
}
</style>

<script type="text/javascript">

function numbersonly(myfield, e, dec) {
  var key;
  var keychar;

  if (window.event)
    key = window.event.keyCode;
  else if (e)
    key = e.which;
  else
    return true;
  keychar = String.fromCharCode(key);

  // control keys
  if ((key==null) || (key==0) || (key== || (key==9) || (key==13) || (key==27) )
    return true;

  // numbers
  else if ((("0123456789").indexOf(keychar) > -1))
    return true;

  // decimal point jump
  else if (dec && (keychar == ".")) {
    myfield.form.elements[dec].focus();
    return false;
  } else
    return false;
}

</script>


</head>
<center>
<body>
<br><Br><Br>
<h1> Search Roll Number </h1>

<Br><br>
<div id="header">
<div id="center">
<table>
<form action="search.php" method="post" onsubmit="return validate_form(this)"> 
<tr>
<td>Roll Number:</td><td><input name="roll_no" type="text" id="roll_no" onkeypress="return numbersonly(this, event)" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="submit" value="search" /></td>
</tr>
</form>
</table>
</div>
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<div id="bar">
</div>
<div id="header">
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>


</body>
</html>
<?php
}
?>

Link to comment
Share on other sites

There Problem Solved No More Javascript All Written in PHP

 

 

Use This for Search.php

 

<?php

$hostname_php_result_conn = "localhost";
$database_php_result_conn = "sex1800_phpresults";
$username_php_result_conn = "sex1800_demo";
$password_php_result_conn = "demotable";   
$php_result_conn = mysql_connect($hostname_php_result_conn, $username_php_result_conn, $password_php_result_conn);
mysql_select_db($database_php_result_conn,$php_result_conn);

if(isset($_POST['submit'])) {

$roll_no = isset($_POST['roll_no'])?trim($_POST['roll_no']):null;

if (!is_null($roll_no) && !empty($roll_no)) {

$string = $roll_no;
$replace = "0";
$result = preg_replace("/[^0-9]/","$replace", $string);
$roll_no = $result;

   $sql = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_no") or die (mysql_error());
$row1 = mysql_fetch_array($sql);
$name = $row1['name'];
$marks = $row1['marks'];
   
}
   if($row1 == 0) {
      echo 'Error, ID does not exist';
   } else {
  

echo 'Name = '.$name.'<br />
Marks = '.$marks;



}  
} else {

?>


<html>
<head>
<style type="text/css">
#header { width:100%;
background:lightblue;
margin:0px;
padding:0px;
}

#leftbar { float:left;
width:40%;
height:30px;
background:lightblue;
text-align:right;
}

#rightbar { float:left;
width:60%;
height:30px;
background:lightblue;
text-align:center;
}

#bar { width:100%;
background:lightblue;
}

#center {float:center;
width:60%;
height:10px;
background:lightblue;
align:center;
}

a { font-family:Arial;
font-size:16px;
background-color:aqua;
color:blue;
font-weight:bold;
vertical-align:text-bottom;
}

a:hover { font-family:Lucida Calligraphy;
font-size:ahoversize1;
background-color:yellow;
color:darkblue;
}
</style>
</head>
<center>
<body>
<br><Br><Br>
<h1> Search Roll Number </h1>

<Br><br>
<div id="header">
<div id="center">
<table>
<form action="search.php" method="post"> 
<tr>
<td>Roll Number:</td><td><input name="roll_no" type="text" id="roll_no" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="submit" value="search" /></td>
</tr>
</form>
</table>
</div>
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<div id="bar">
</div>
<div id="header">
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>


</body>
</html>
<?php
}
?>

 

Demo Here http://1800sexnow.com/demos/search/search.php

 

*If user Types Nothing Displays "Error, ID does not exist"

*If User types Anything other than a number displays "Error, ID does not exist"

*Displays "Error, ID does not exist" if roll_no does not exist

Link to comment
Share on other sites

Updated Code:

Added Better Display of ID & If ID Does Not Exist

Demo Here: http://1800sexnow.com/demos/search/search.php

 

<?php

$hostname_php_result_conn = "localhost";
$database_php_result_conn = "sex1800_phpresults";
$username_php_result_conn = "sex1800_demo";
$password_php_result_conn = "demotable";   
$php_result_conn = mysql_connect($hostname_php_result_conn, $username_php_result_conn, $password_php_result_conn);
mysql_select_db($database_php_result_conn,$php_result_conn);

if(isset($_POST['submit'])) {

$roll_no = isset($_POST['roll_no'])?trim($_POST['roll_no']):null;

if (!is_null($roll_no) && !empty($roll_no)) {

$string = $roll_no;
$replace = "0";
$result = preg_replace("/[^0-9]/","$replace", $string);
$roll_no = $result;

   $sql = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_no") or die (mysql_error());
$row1 = mysql_fetch_array($sql);
$name = $row1['name'];
$marks = $row1['marks'];
   

   if($row1 == 0) {
?>

<!-- Role Number Does Not Exist --!>

<head>
<style type="text/css">
#header { width:100%;
background:lightblue;
margin:0px;
padding:0px;
}

#leftbar { float:left;
width:40%;
height:30px;
background:lightblue;
text-align:right;
}

#rightbar { float:left;
width:60%;
height:30px;
background:lightblue;
text-align:center;
}

#bar { width:100%;
background:lightblue;
}

#center {float:center;
width:60%;
height:10px;
background:lightblue;
align:center;
}

a { font-family:Arial;
font-size:16px;
background-color:lightblue;
color:blue;
font-weight:bold;
vertical-align:text-bottom;
}

a:hover { font-family:arial;
font-size:ahoversize1;
background-color:black;
color:darkblue;
}
</style>
</head>

<center>
<br><Br><Br>

<h1> Error </h1><br>
  
<div id="header">
<div id="center">
<table>
<tr>
<td><b><?php echo 'Error, ID does not exist'; ?></b></td>
</tr>
<tr>
<td><a href="./search.php">Search Again</a></td>
</tr>
</table>
</div>
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<div id="bar">
</div>
<div id="header">
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<!-- Role Number Does Not Exist --!>




  <?php    
   } else {

?>

<!-- Start of After Submitted Contet --!>

<head>
<style type="text/css">
#header { width:100%;
background:lightblue;
margin:0px;
padding:0px;
}

#leftbar { float:left;
width:40%;
height:30px;
background:lightblue;
text-align:right;
}

#rightbar { float:left;
width:60%;
height:30px;
background:lightblue;
text-align:center;
}

#bar { width:100%;
background:lightblue;
}

#center {float:center;
width:60%;
height:10px;
background:lightblue;
align:center;
}

a { font-family:Arial;
font-size:16px;
background-color:aqua;
color:blue;
font-weight:bold;
vertical-align:text-bottom;
}

a:hover { font-family:Lucida Calligraphy;
font-size:ahoversize1;
background-color:yellow;
color:darkblue;
}
</style>
</head>

<center>
<br><Br><Br>

<h1> Name <?php echo "$name"; ?> </h1><br>
  
<div id="header">
<div id="center">
<table>
<tr>
<td><b>Marks:</b></td>
</tr>
<tr>
<td><?php echo "$marks"; ?></td>
</tr>
</table>
</div>
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<div id="bar">
</div>
<div id="header">
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<!-- End of Role Number Display --!>

<?php 
}  
}
} else {

?>


<html>
<head>
<style type="text/css">
#header { width:100%;
background:lightblue;
margin:0px;
padding:0px;
}

#leftbar { float:left;
width:40%;
height:30px;
background:lightblue;
text-align:right;
}

#rightbar { float:left;
width:60%;
height:30px;
background:lightblue;
text-align:center;
}

#bar { width:100%;
background:lightblue;
}

#center {float:center;
width:60%;
height:10px;
background:lightblue;
align:center;
}

a { font-family:Arial;
font-size:16px;
background-color:aqua;
color:blue;
font-weight:bold;
vertical-align:text-bottom;
}

a:hover { font-family:Lucida Calligraphy;
font-size:ahoversize1;
background-color:yellow;
color:darkblue;
}
</style>
</head>
<center>
<body>
<br><Br><Br>
<h1> Search Roll Number </h1>

<Br><br>
<div id="header">
<div id="center">
<table>
<form action="search.php" method="post"> 
<tr>
<td>Roll Number:</td><td><input name="roll_no" type="text" id="roll_no" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="submit" value="search" /></td>
</tr>
</form>
</table>
</div>
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>
<div id="bar">
</div>
<div id="header">
<div id="leftbar">
</div>
<div id="rightbar">
</div>
</div>


</body>
</html>
<?php
}
?>

Link to comment
Share on other sites

  • 4 months later...

I have re-written the whole code

 

index.php - The page where student will search for his result by entering roll number in text box

 

<?php
// Connection to database
//require_once ("includes/settings.php")
$hostname = "localhost";
$database = "phpresult";
$username = "root";
$password = "demojoomla";   
$conn = mysql_connect($hostname, $username, $password);
mysql_select_db($database,$conn);

if(isset($_POST['submit'])) {
   $roll_number = $_POST['roll_no_textbox'];
   
   $sql1 = mysql_query("SELECT roll_no FROM result-table WHERE roll_no = $roll_number");
   $row1 = mysql_num_rows($sql1);
   
   if($row1 == 0) {
      echo 'Error, ID does not exist';
   } else {
      header('Location: result.php?roll_no='.$roll_number);
   }   
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>

<body>
<table width="664" height="260" border="0">
  <tr>
    <td height="88"> </td>
  </tr>
  <tr>
    <td><p> </p>
      <form id="form1" name="form1" method="post" action="result.php">
        <div align="center">
          <label>Roll Number :
          <input type="text" name="roll_no_textbox" id="roll_no_textbox" />
          </label>
          <label>
          <input type="submit" name="button" id="button" value="search" />
          </label>
        </div>
      </form>
      <p align="center"> </p>
    <p> </p></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
</table>
</body>
</html>

 

result.php - The page of result

 

<?php
$hostname = "localhost";
$database = "phpresult";
$username = "root";
$password = "demojoomla";   
$conn = mysql_connect($hostname, $username, $password);
mysql_select_db($database,$conn);
$roll_number = $_GET['roll_no_textbox'];

$sql1 = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_number");
$row1 = mysql_fetch_array($sql1);
//$exam1 = $row1['exam1'];
//$exam2 = $row1['exam2'];
$result_name = $row1['name'];
$result_roll_number = $row1['roll_no'];
$result_accounts_l = $row1['accounts-l'];
$result_accounts_ll = $row1['accounts-ll'];
$result_accounts_lll = $row1['accounts-lll'];
$result_mpp = $row1['mpp'];
$result_economy = $row1['economy'];
$result_taxation = $row1['taxation'];
$result_computer = $row1['computer'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="664" height="260" border="0">
  <tr>
    <td height="88"> </td>
  </tr>
  <tr>
    <td><p align="center">Your Result is here ...</p>
      
      <table width="649" height="189" border="0">
        <tr>
          <td colspan="4">Name : <?php echo $result_name ?></td>
        </tr>
        <tr>
          <td colspan="2">Roll Number : <?php echo $result_roll_number ?></td>
          <td colspan="2"> </td>
        </tr>
        <tr>
          <td width="156"><div align="right">Accounts I : </div></td>
          <td width="160"><?php echo $result_accounts_l ?></td>
          <td width="160"><div align="right">Economics : </div></td>
          <td width="155"><?php echo $result_economics ?></td>
        </tr>
        <tr>
          <td><div align="right">Accounts II : </div></td>
          <td><?php echo $result_accounts_ll ?></td>
          <td><div align="right">MPP : </div></td>
          <td><?php echo $result_mpp ?></td>
        </tr>
        <tr>
          <td><div align="right">Accounts III : </div></td>
          <td><?php echo $result_accounts_lll ?></td>
          <td><div align="right">Taxation : </div></td>
          <td><?php echo $result_taxation ?></td>
        </tr>
        <tr>
          <td colspan="2"> </td>
          <td colspan="2"> </td>
        </tr>
      </table>
      <div align="center"></div>
      <p align="center"> </p>
      <p align="center"> </p>
      <p> </p></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
</table>
</body>
</html>

 

When I search for roll number 1 , its giving error on top of result.php

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\xampp\htdocs\PHPresult\result.php on line 11

 

 

Whats the problem ? I think its there in

 

$row1 = mysql_fetch_array($sql1);

 

I am confused .. :-[ :-[ :-[

Link to comment
Share on other sites

Yes. The query ran in line 10 of result.php fails. That's why you should try to see what error it produces.

Change line 10 to

$sql1 = mysql_query("SELECT * FROM result_table WHERE roll_no = $roll_number") or die(mysql_error());

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.