\n"; echo "
\n"; echo "\n"; echo "\n"; foreach($tables as $table) echo ""; echo "\n"; foreach($tables as $table) { echo "\n"; } echo "
$table
\n"; $result = mysql_query("show fields in $table"); while($row = mysql_fetch_array($result, MYSQL_NUM)) echo "\n"; echo "
".$row[0]."
\n"; echo "
\n"; include("fields.html"); echo "
\n"; echo "

Type in a query here, following the example syntax\n"; if(array_key_exists('QUERY',$_SESSION)) $query=$_SESSION['QUERY']; else $query=''; echo "

\n"; echo "\n"; echo "

\n"; echo "

\n"; echo "

Help with Syntax
\n"; echo "\n"; echo "Examples:
\n"; echo "select raw.*,raw.calage-(raw.calspan-1)/2 as calmidpt,labid,sets.author,sets.comment from cooked join raw using (datno,setno,division,subdivision) join sets using (setno,division,subdivision) where setno<10
\n"; echo "Select * from sets
\n"; echo "Select * from raw where setno=11
\n"; echo "select calage,calage-(calspan-1)/2,calspan,c14age,c14sig,kind from raw join sets using (setno) where setno=7
\n"; echo "select * from raw join sets using (setno) where author like 'cams%'
\n"; echo "select raw.setno,labid,reservoirage from raw join cooked using (datno) where reservoirage>500 order by reservoirage
\n"; echo "select calage,c14age,calsig,c14sig from cooked where calage between 12500 and 50000
\n"; echo "It is possible to execute these queries from within the R programming language
\n"; echo "\n"; ?>