Parse error: syntax error, unexpected ">" in C:/wamp/www/new.phpon line 38
am 14.02.2009 04:02:55 von Sashikanth GurramHi all,
I have pasted the PHP code I wrote below. I do not know why, but I am
getting the parse error: unexpected '>'. It says the error is on line
38. The exact line on line 38 is
* echo"
Basically, I am trying to execute an sql query through PHP which tries
to extract data from the mysql database and display the data in the
browser. The query is running fine but I am getting the problems when I
try to display the data in the browser.
Can anyone help me with it?
Thanks,
Sashi
/* CONNECTS TO THE DATABASE*/
$host="******";
$user="******";
$password="*******";
$dbname="*********";
$cxn=mysqli_connect($host, $user, $password, $dbname);
if (!$cxn=mysqli_connect($host, $user, $password, $dbname))
{
$error=mysqli_error($cxn);
echo "$error";
die();
}
else
{
echo "Connection established successfully";
}
$sql="select * FROM OCCUPANCY";
$data=mysqli_query($cxn,$sql);
if (!$data=mysqli_query($cxn,$sql))
{
$error=mysqli_error($cxn);
echo "$error";
die();
}
else
{
echo "Query sent successfully";
}
echo "
";
echo "
OCCUPANCY";
echo "
echo "
$building | \n$parking_lot | \n$month | \n$day | \n$occupancy | \n$empty_spaces | \n$special_days | \n
?>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sashikanth Gurram
Graduate Research Assistant
Department of Civil and Environmental Engineering
Virginia Tech
Blacksburg, VA 24060, USA
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Parse error: syntax error, unexpected ">" in
am 14.02.2009 06:54:15 von Patrick Price--0016368e268f68b3480462da95e8 WOW,
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I believe your problem is that on line 33 you forgot your closing double
quote in the echo statement.
Thanks
patrick
Sent from: Decatur Ga United States.
On Fri, Feb 13, 2009 at 10:02 PM, Sashikanth Gurram
> Hi all,
>
> I have pasted the PHP code I wrote below. I do not know why, but I am
> getting the parse error: unexpected '>'. It says the error is on line 38.
> The exact line on line 38 is
> * echo"\n*
>
> Basically, I am trying to execute an sql query through PHP which tries to
> extract data from the mysql database and display the data in the browser.
> The query is running fine but I am getting the problems when I try to
> display the data in the browser.
>
> Can anyone help me with it?
>
> Thanks,
> Sashi
>
>
> /* CONNECTS TO THE DATABASE*/
> $host="******";
> $user="******";
> $password="*******";
> $dbname="*********";
> $cxn=mysqli_connect($host, $user, $password, $dbname);
> if (!$cxn=mysqli_connect($host, $user, $password, $dbname))
> {
> $error=mysqli_error($cxn);
> echo "$error";
> die();
> }
> else
> {
> echo "Connection established successfully";
> }
> $sql="select * FROM OCCUPANCY";
> $data=mysqli_query($cxn,$sql);
> if (!$data=mysqli_query($cxn,$sql))
> {
> $error=mysqli_error($cxn);
> echo "$error";
> die();
> }
> else
> {
> echo "Query sent successfully";
> }
> echo "
";
> echo "OCCUPANCY
";
> echo "";
\n";
> echo " ;
> while ($row=mysqli_fetch_array($data))
> {
> extract($row);
> echo"\n \n";
> $building \n
> $parking_lot \n
> $month \n
> $day \n
> $occupancy \n
> $empty_spaces \n
> $special_days \n
>
> echo " \n";
> }
> echo"
> ?>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Sashikanth Gurram
> Graduate Research Assistant
> Department of Civil and Environmental Engineering
> Virginia Tech
> Blacksburg, VA 24060, USA
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--0016368e268f68b3480462da95e8--
Re: Parse error: syntax error, unexpected ">" in C:/wamp/www/new.phpon line 38
am 14.02.2009 06:59:17 von Sashikanth Gurram
Both of your suggestions worked like magic. Thanks a lot Patrick
-Sashi
Patrick Price wrote:
> I believe your problem is that on line 33 you forgot your closing double
> quote in the echo statement.
>
> Thanks
>
> patrick
> Sent from: Decatur Ga United States.
>
>
> On Fri, Feb 13, 2009 at 10:02 PM, Sashikanth Gurram
>
>
>> Hi all,
>>
>> I have pasted the PHP code I wrote below. I do not know why, but I am
>> getting the parse error: unexpected '>'. It says the error is on line 38.
>> The exact line on line 38 is
>> * echo"\n*
>>
>> Basically, I am trying to execute an sql query through PHP which tries to
>> extract data from the mysql database and display the data in the browser.
>> The query is running fine but I am getting the problems when I try to
>> display the data in the browser.
>>
>> Can anyone help me with it?
>>
>> Thanks,
>> Sashi
>>
>>
>> /* CONNECTS TO THE DATABASE*/
>> $host="******";
>> $user="******";
>> $password="*******";
>> $dbname="*********";
>> $cxn=mysqli_connect($host, $user, $password, $dbname);
>> if (!$cxn=mysqli_connect($host, $user, $password, $dbname))
>> {
>> $error=mysqli_error($cxn);
>> echo "$error";
>> die();
>> }
>> else
>> {
>> echo "Connection established successfully";
>> }
>> $sql="select * FROM OCCUPANCY";
>> $data=mysqli_query($cxn,$sql);
>> if (!$data=mysqli_query($cxn,$sql))
>> {
>> $error=mysqli_error($cxn);
>> echo "$error";
>> die();
>> }
>> else
>> {
>> echo "Query sent successfully";
>> }
>> echo "
";
>> echo "OCCUPANCY
";
>> echo "";
\n";
>> echo " ;
>> while ($row=mysqli_fetch_array($data))
>> {
>> extract($row);
>> echo"\n \n";
>> $building \n
>> $parking_lot \n
>> $month \n
>> $day \n
>> $occupancy \n
>> $empty_spaces \n
>> $special_days \n
>>
>> echo " \n";
>> }
>> echo"
>> ?>
>>
>> --
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Sashikanth Gurram
>> Graduate Research Assistant
>> Department of Civil and Environmental Engineering
>> Virginia Tech
>> Blacksburg, VA 24060, USA
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sashikanth Gurram
Graduate Research Assistant
Department of Civil and Environmental Engineering
Virginia Tech
Blacksburg, VA 24060, USA
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php