Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Modified to present questions/export in natural sort order (ie: quest…
…ion 9 comes before question 10)

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1108 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Jul 28, 2004
1 parent 63fec28 commit 591e07b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions admin/export.php
Expand Up @@ -49,12 +49,27 @@
$result=mysql_query($query) or die("Couldn't count fields<br />$query<br />".mysql_error());
$afieldcount=mysql_num_fields($result);
$i=0;
while($i<$afieldcount)
$fieldmap=createFieldMap($sid);
foreach ($fieldmap as $fm)
{
$meta=mysql_fetch_field($result, $i);
$excesscols[]=$meta->name;
$i++;
$query="SELECT group_name, title\n"
."FROM questions, groups\n"
."WHERE questions.gid=groups.gid\n"
."AND questions.qid='".$fm['qid']."'";
$result=mysql_query($query) or die("EXPORT: Fieldmap-$query<br />".mysql_error());
while ($row=mysql_fetch_array($result))
{
$groupname=$row['group_name'];
$title=$row['title'];
}
$eachone[]=array("fieldname"=>$fm['fieldname'],
"group_name"=>$groupname,
"title"=>$title);
}
foreach($eachone as $ea)
{
$excesscols[]=$ea['fieldname'];
}
echo $htmlheader
."<br />\n"
."<table align='center'><tr>"
Expand Down

0 comments on commit 591e07b

Please sign in to comment.