help-- why cant this php page be processed inside a html document....but when i run it on its own in a php document it works fine.
any ideas?? i have to run it inside a html page in a table ...thank you.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="464" height="95" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
function hapa()
{
ini_set("always_populate_raw_post_data", true);
// Include the database details, and make a connection
include("../tusha_details/tusha_details.php");
$stmt = "SELECT author, body, date from ken_aboutus where state='sa'";
// Get all the posts and necessary information
$result = @mysql_query($stmt, $db);
// Did we get a result?
if (!$result) {
echo "SQL query failed. Please try again.";
exit;
}
// Find the number of rows returned (i.e. the number of posts)
$numRows = @mysql_num_rows($result);
// Were there any rows?
if ($numRows <= 0) {
// No rows were returned, there mustn't be any entries
echo "There are currently no entries in the database.";
exit;
}
$row = mysql_fetch_array($result);
$body=$row['body'];
$author= $row['author'];
$date=$row['date'];
echo $body ;
echo $author ;
echo $date ;
}
$content = hapa();
echo $content;
?>
</td>
</tr>
</table>
</body>
</html>
any ideas?? i have to run it inside a html page in a table ...thank you.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="464" height="95" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
function hapa()
{
ini_set("always_populate_raw_post_data", true);
// Include the database details, and make a connection
include("../tusha_details/tusha_details.php");
$stmt = "SELECT author, body, date from ken_aboutus where state='sa'";
// Get all the posts and necessary information
$result = @mysql_query($stmt, $db);
// Did we get a result?
if (!$result) {
echo "SQL query failed. Please try again.";
exit;
}
// Find the number of rows returned (i.e. the number of posts)
$numRows = @mysql_num_rows($result);
// Were there any rows?
if ($numRows <= 0) {
// No rows were returned, there mustn't be any entries
echo "There are currently no entries in the database.";
exit;
}
$row = mysql_fetch_array($result);
$body=$row['body'];
$author= $row['author'];
$date=$row['date'];
echo $body ;
echo $author ;
echo $date ;
}
$content = hapa();
echo $content;
?>
</td>
</tr>
</table>
</body>
</html>