header
$id = intval($_GET['id']);
$query = mysql_query("SELECT * FROM table WHERE id = $id");
view
while ($row = mysql_fetch_array($query)) {
$column1 = $row['column1'];
$column2 = $row['column2'];
$column3 = $row['column3'];
echo $column1.......
}
How can I keep the above code in my header file?
So my designers wont have to see it?
Can you save the data into variables and print it out on the page?
Thanks!
You could create a function which takes the $GET_[‘id’] value as a parameter and returns whatever is supposed to be echo’d.
Something like: (inc.php)
and then in your main file: