So I have this code for my webpage but whenever I put in the "include" php code
<?php
include('include/mysqli.inc');
?>
everything below that disappears. Basically I'm trying to enter in the appropriate variable data from the quotes database that I'm using into the correct table fields. But I can't do this if the include code line keeps making my tables disappear!
Help!
Here's the main source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
ob_start();
require ('require/dbUtil.inc');
$objDBUtil = new DbUtil;
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="default.css" />
<?php
include('include/header.php');
?>
</head>
<body>
<div id="tableMain">
<div class="leftpanel">
<center>
<h2><b><u>Directory</u></b></h2>
<a href="default.php"><b>Home</b></a>
<br /><br />
<a href="findsymbol.php"><b>Find Symbol</b></a>
<br /><br />
<a href="quote.php"><b>Quote</b></a>
<br /><br />
<a href="history.php"><b>History</b></a>
<br /><br />
<hr align="center" width="50"></br></center>
<center><b><u>**DISCLAIMER**</u></b></br></br>
This website is intended for kicks and play--none of the information you find within this website should be taken into consideration when investing in stocks.
</center>
</div>
<div class="contentbox">
<center>
<div class="fillbox">
<br />
<form action="quote.php" method="get">Symbol:
<input type="text" name="symbol"/>
<input type="submit" value="Search"/>
</form>
<?php
include('include/mysqli.inc');
?>
<br />
<left><h2>Stock Symbol: <b><font color="yellow">
<?php
print $symSymbol;
?>
</font></b></h2></font></left>
<h4><font color="green">2011-05-04 16:00:00 NASDAQ</font></h4>
<table width=670 border=0 cellspacing=0 cellpadding=0 align=center>
<tr class=tblHead bgcolor="blue">
<td align=left colspan=2><b><font color="yellow">Google, Inc.
<?php
print $symName;
?>
</font></b></td>
</tr>
</table>
<table id="stockTable1" width=670 border=1 cellpadding=0 cellspacing=0 rules=rows frame=below
bordercolor="blue" bordercolordark="white" align=center>
<tr>
<td width=10 > </td>
<td width=100>Last</td>
<td width=80 align=right><font color="black">535.79</font></td>
<td width=30 > </td>
<td width=100>Prev Close</td>
<td width=80 align=right><font color="black">533.89</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>Change</td>
<td width=80 align=right><font color="black">+1.90</font></td>
<td width=30 > </td>
<td width=100>Bid</td>
<td width=80 align=right><font color="black">535.80</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>%Change</td>
<td width=80 align=right><font color="black">+0.36%</font></td>
<td width=30 > </td>
<td width=100>Ask</td>
<td width=80 align=right><font color="black">534.79</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>High</td>
<td width=80 align=right><font color="black">539.00</font></td>
<td width=30 > </td>
<td width=100>52 Week High</td>
<td width=80 align=right><font color="black">642.96</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>Low</td>
<td width=80 align=right><font color="black">533.02</font></td>
<td width=30 > </td>
<td width=100>52 Week Low</td>
<td width=80 align=right><font color="black">433.63</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>Daily Volume</td>
<td width=80 align=right><font color="black">2,115,923</font></td>
</tr>
</table>
<br />
<table width=670 border=0 cellspacing=0 cellpadding=0 align=center>
<tr class=tblTail bgcolor="blue">
<td align=left colspan=2><b><font color="yellow">Fundamentals</font></b></td>
</tr>
</table>
<table id="stockTable2" width=670 border=0 cellpadding=0 cellspacing=0 rules=rows frame=below
bordercolor="blue" bordercolordark="white" align=center>
<tr>
<td width=10 > </td>
<td width=100>PE Ratio</td>
<td width=80 align=right><font color="black">19.56</font></td>
<td width=30 > </td>
<td width=100>Market Cap.</td>
<td width=80 align=right><font color="black">133,413.0 Mil</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>Earnings/share</td>
<td width=80 align=right><font color="black">27.29</font></td>
<td width=30 > </td>
<td width=100># Shrs Out.</td>
<td width=80 align=right><font color="black">321,527,000</font></td>
</tr>
<tr>
<td width=10 > </td>
<td width=100>Div/Share</td>
<td width=80 align=right><font color="black">0.00</font></td>
<td width=30 > </td>
<td width=100>Div. Yield</td>
<td width=80 align=right><font color="black">n/a</font></td>
</tr>
</table>
</center></div></div>
<?php
include('include/footer.php');
?>
</body>
</br>
</html>
<?php
ob_end_flush();
?>
And here's my mysqli.inc code:
<?php
include ('require/dbUtil.inc');
ob_start();
$strSymbol = @$_REQUEST["symbol"];
if(! empty($strSymbol))
{
$db = $objDBUtil->Open();
$query = "SELECT symSymbol, symName FROM symbols WHERE symSymbol=" . $objDBUtil->DBQuotes($strSymbol);
$result = $db->query($query);
if (! $result)
{
print "Invalid query result<br />\n";
}
else
{
$row = @$result->fetch_assoc();
}
@$result->free();
$querysymbol = $objDBUtil->DBQuotes($strSymbol);
$query = "HERETOouterjoin
SELECT symSymbol, symName, qSymbol, qQuoteDateTime, qLastSalePrice
FROM symbols LEFT OUTER JOIN quotes ON symSymbol=qSymbol
WHERE symSymbol={$querysymbol}
ORDER BY qQuoteDateTime DESC
LIMIT 10
HERETOouterjoin";
$result = @$db->query($query);
if($result)
{
while($row = @$result->fetch_assoc())
{
extract($row);
if($qQuoteDateTime == NULL) $qQuoteDateTime = "No Quote Data";
if($qLastSalePrice == NULL) $qLastSalePrice = "-.--";
}
}
@$result->free();
$objDBUtil->Close();
}
?>