Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Php file just views code
Php file just views code [message #736994] Fri, 14 October 2011 14:52 Go to next message
tal23112 is currently offline tal23112Friend
Messages: 6
Registered: October 2011
Junior Member
I made a php file in format like:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM Persons");

while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";
}

mysql_close($con);
?>
but when i run that on internet instead of runnung the code it shows me the whole code on the window ,what is the problem?
Re: Php file just views code [message #736996 is a reply to message #736994] Fri, 14 October 2011 14:53 Go to previous messageGo to next message
tal23112 is currently offline tal23112Friend
Messages: 6
Registered: October 2011
Junior Member
And i did add <html>
<head>...

<body>
(code)
</body>
Re: Php file just views code [message #737233 is a reply to message #736996] Fri, 14 October 2011 20:26 Go to previous messageGo to next message
Denis Roy is currently offline Denis RoyFriend
Messages: 483
Registered: October 2004
Location: Ottawa, Ontario, Canada
Senior Member

http://lmgtfy.com/?q=php+file+shows+code

Denis Roy
Eclipse Webmaster -- webmaster@eclipse.org
Re: Php file just views code [message #739601 is a reply to message #736994] Mon, 17 October 2011 16:38 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
These forums are for discussing Eclipse. I don't see anything in your
question relating to Eclipse.

Try asking on a PHP forum.



On 10/14/11 10:52 AM, tal23112 wrote:
> I made a php file in format like: <?php
> $con = mysql_connect("localhost","peter","abc123");
> if (!$con)
> {
> die('Could not connect: ' . mysql_error());
> }
>
> mysql_select_db("my_db", $con);
>
> $result = mysql_query("SELECT * FROM Persons");
>
> while($row = mysql_fetch_array($result))
> {
> echo $row['FirstName'] . " " . $row['LastName'];
> echo "<br />";
> }
>
> mysql_close($con);
> ?> but when i run that on internet instead of runnung the code it shows
> me the whole code on the window ,what is the problem?
Previous Topic:Progress Bar on a Jface dialog
Next Topic:droid program help
Goto Forum:
  


Current Time: Tue Mar 19 14:00:18 GMT 2024

Powered by FUDForum. Page generated in 0.02642 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top