<?
include('*********/db.php');
$id = "null";
$id = $_GET['id'];
if ( $id == "null" ){
$id = "1";
}
mysql_pconnect("$host","$user","$pass");
mysql_select_db("$base");
$result = mysql_query("SELECT title , content FROM pages WHERE id = $id ");
while($r=mysql_fetch_array($result)){
$title=$r["title"];
$content=$r["content"];
?>
<title><? echo "$title"; ?></title><link href="*********/style.css" rel="stylesheet" type="text/css">
<div id="header"><? /* header */ ?></div>
<div id="rule"></div>
<div id="container">
<div id="menu"><? include('inc/menu.php'); ?></div>
<div id="main"><? echo "$content"; ?></div>
</div>
<?
}
?>
i'm probably going the wrong way about it so i'll try and explain 1st.
i want to use the http_get_var/$GET thing to specify an id in the mysql query, but if there is no http_get_var/$GET i want the id in the query to default to 1.... i'll be damned if i can work it out lol.
thanks all