I'm trying to run three independent queries on the same page. I keep getting the error: Parse error: parse error, unexpected $
I'm using PHP 4.22, MySQL 3.23, IIS 5 on WinXP.
What am I doing wrong?
<?php
// includes
include("../../includes/config.php");
include("../../includes/functions.php");
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
?>
Some html.
Query 1:
<?php
// includes
include("../../includes/config.php");
include("../../includes/functions.php");
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
?>
Some more html.
<?php
// generate and execute query
$qryListPressRelease = "SELECT PressReleaseID, PressReleaseHeadline, PressReleaseDate FROM tblPressRelease ORDER BY PressReleaseDate DESC";
$rsltListPressRelease = mysql_query($qryListPressRelease) or die ("Error in query: $qryListPressRelease. " . mysql_error());
// if records present
if (mysql_num_rows($rsltListPressRelease) > 0)
{
// iterate through resultset
// print title with links to edit and delete scripts
while($row = mysql_fetch_object($rsltListPressRelease))
{
?>
<?php $row->PressReleaseHeadline; ?>
Some more htmll.
Query 2:
<?php
// generate and execute query
$qryListFunction = "SELECT FunctionName FROM tblFunction ORDER BY FunctionName DESC";
$rsltListFunction = mysql_query($qryListFunction) or die ("Error in query: $qryListFunction. " . mysql_error());
// if records present
if (mysql_num_rows($rsltListFunction) > 0)
{
// iterate through resultset
// print title with links to edit and delete scripts
while($row2 = mysql_fetch_object($rsltListFunction))
{
?>
<?php $row2->FunctionName; ?>
Query 3:
<?php
// generate and execute query
$qryListSubFunction = "SELECT SubFunctionName FROM tblSubFunctionName ORDER BY SubFunctionName DESC";
$rsltListSubFunction = mysql_query($qryListSubFunction) or die ("Error in query: $qryListFunction. " . mysql_error());
// if records present
if (mysql_num_rows($rsltListSubFunction) > 0)
{
// iterate through resultset
// print title with links to edit and delete scripts
while($row3 = mysql_fetch_object($rsltListSubFunction))
{
?>
<?php $row3->SubFunctionName; ?>
Thanks.