Jump to content

What does this error mean?


fishfin

Recommended Posts

OK, here it is:

<?php
$page_number = $_GET['page'];

$connect = mysql_connect("localhost","root","pass");
if (!$connect)
	{
	die('Error connecting to database. Mysql error: ' . mysql_error());
	}

mysql_select_db("database", $connect);

$outcome = mysql_query("SELECT * FROM pages WHERE id = '$page_number'");

while($result = mysql_fetch_array($outcome))
	{
	echo <<<END
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Site -  . $result['title'] . </title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="all">
<div class="top">
<br />
           MySite.com
</div>
<div class="links">
<a class="link" href="#">Home</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Guangxi</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Nanning</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Beihai</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Guilin</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Liuzhuo</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Other Cities</a> <img src="line.bmp" alt="" /> <a class="link" href="#">About Me</a> <img src="line.bmp" alt=""/> <a class="link" href="#">Contact Me</a>
</div>
<div class="body">
<div class="head1"> . $result['up'] . </div>
. $result['content'] . 
</div>
<div class="links">
&copy 2007 Caleb Hansen
</div>
</div>
</body>
</html>
END;
	}
mysql_close($connect);
?>

Your code should be like this , you need to check out some tutorials (there are lots in www.phpfreaks.com)

 

<?php
$page_number = $_GET['page'];
//connection
$connect = mysql_connect("localhost","root","pass");
if (!$connect)
	{
	die('Error connecting to database. Mysql error: ' . mysql_error());
	}
mysql_select_db("database", $connect);
//output
$outcome = mysql_query("SELECT * FROM pages WHERE id = '$page_number'");
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Site </title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="all">
<div class="top">
<br />
           MySite.com
</div>
<div class="links">
<a class="link" href="#">Home</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Guangxi</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Nanning</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Beihai</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Guilin</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Liuzhuo</a> <img src="line.bmp" alt="" /> <a class="link" href="#">Other Cities</a> <img src="line.bmp" alt="" /> <a class="link" href="#">About Me</a> <img src="line.bmp" alt=""/> <a class="link" href="#">Contact Me</a>
</div>
<?php while($result = mysql_fetch_array($outcome))
	{
	echo "What to echo here ";?>
<div class="body">
<div class="head1"><?php echo $result['up']?></div>
<?php echo $result['content'] ?>
</div>
<? } ?>
<div class="links">
&copy 2007 Caleb Hansen
</div>
</div>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.