I am currently trying to write an SQL query to a session variable.
When I try and run the code I get the following errors:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at d:\php\session.php:8) in d:\php\session.php on line 9
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at d:\php\session.php:8) in d:\php\session.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at d:\php\session.php:8) in d:\php\session.php on line 10
The code I am trying to execute is this:
<?php
session_start();
$sql = "SELECT * FROM TABLE";
$_SESSION['sql'] = $sql;
echo $_SESSION['sql'];
?>
Any ideas?