Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page Display result one same page(template) using Php
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Member
linegreen04 is on a distinguished road
 
Posts: 51
Join Date: Apr 2012
Default Display result one same page(template) using Php - 05-14-2012, 03:46 PM

Dear all
I'm Using these codes for displaying my results and getting displayed but there is some problem as i got display on other page which has no images,header,(my template look) so i want to ask how to display that on my template (using my header or etc as on my home page look).

PHP Code:
<?php
$db
=mysql_connect('mysqlX.000webhost.com','axxxxx','xxxxx');
mysql_select_db('axxxxx'$db);

$result mysql_query('SELECT student.Roll, student.Stream, Marks.Session, student.Name, student.Mother_Name, student.Father_Name, Marks.Total_Marks, Marks.Grade, Marks.Result'
        
' FROM student'
        
' INNER JOIN Marks'
        
' ON student.Roll=Marks.Roll LIMIT 0, 30 ',$db);


echo 
"<table border='1'>
<tr>
<td>Roll</td>
<td>Stream</td>
<td>Session</td>
<td>Name</td>
<td>Mother Name</td>
<td>Father Name</td>
<td>Total Mark's</td>
<td>Grade</td>
<td>Result</td>
</tr>"
;

while(
$row mysql_fetch_array($result))
  {
  echo 
"<tr>";
  echo 
"<td>" $row['Roll'] . "</td>";
  echo 
"<td>" $row['Stream'] . "</td>";
  echo 
"<td>" $row['Session'] . "</td>";
  echo 
"<td>" $row['Name'] . "</td>";
  echo 
"<td>" $row['Mother_Name'] . "</td>";
  echo 
"<td>" $row['Father_Name'] . "</td>";
  echo 
"<td>" $row['Total_Marks'] . "</td>";
  echo 
"<td>" $row['Grade'] . "</td>";
  echo 
"<td>" $row['Result'] . "</td>";
  echo 
"</tr>";
  }
echo 
"</table>";
?>

Last edited by linegreen04; 05-14-2012 at 03:47 PM. Reason: Password pasted
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Senior Member
grace1004 is on a distinguished road
 
Posts: 735
Join Date: Dec 2010
Default 05-14-2012, 10:44 PM

The following is an example:

Code:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>SAMPLE SITE</title>
<link rel="stylesheet" href="global.css">
</head>
<body>
<?  
//Put header or top menu file
include 'header.html';
include 'top_menu.php'; 
?>
<br>
<table style="border-width:1; border-style:solid;" border="0" cellpadding="0" cellspacing="0" width="938">
  <tr>
    <td width="210" height="376" valign="top">
	  <?  
      //To put login menu
      include 'left_login.php';  

      //To put left menu
      include 'main_left.php';  
      ?>
    </td>

// Put your php script
<?php
$db=mysql_connect('mysqlX.000webhost.com','axxxxx','xxxxx');
mysql_select_db('axxxxx', $db);
.
.
.
echo "</table>";

//Put footer file 
include 'footer.html';
?>

</body>
</html>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com