Skip to content

Commit

Permalink
Removed trailing semi-colon from SQL statements (as per PHP note for …
Browse files Browse the repository at this point in the history
…mysql_query).

Changed the number of header lines to be compatible with importsurvey.php. (v1.2 reformatting of export broke import).


git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@56 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
James Richards committed Mar 18, 2003
1 parent 2474917 commit 305132c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admin/dumpsurvey.php
Expand Up @@ -53,14 +53,14 @@

$dumphead = "# SURVEYOR SURVEY DUMP\n";
$dumphead .= "#\n# This is a dumped survey from the PHPSurveyor Script\n";
$dumphead .= "# http://phpsurveyor.sourceforge.net/\n#\n\n";
$dumphead .= "# http://phpsurveyor.sourceforge.net/\n";

function BuildOutput($Query)
{
$QueryResult = mysql_query($Query);
preg_match('/FROM (\w+)( |,)/i', $Query, $MatchResults);
$TableName = $MatchResults[1];
$Output = "\n#\n# " . strtoupper($TableName) . " TABLE\n#\n";
$Output = "\n# NEW TABLE\n# " . strtoupper($TableName) . " TABLE\n#\n";
while ($Row = mysql_fetch_assoc($QueryResult))
{
$ColumnNames = "";
Expand All @@ -73,7 +73,7 @@ function BuildOutput($Query)
$ColumnNames = substr($ColumnNames, 0, -2); //strip off last comma space
$ColumnValues = substr($ColumnValues, 0, -2); //strip off last comma space

$Output .= "INSERT INTO $TableName ($ColumnNames) VALUES\n ($ColumnValues);\n";
$Output .= "INSERT INTO $TableName ($ColumnNames) VALUES ($ColumnValues)\n";
}
return $Output;
}
Expand Down

0 comments on commit 305132c

Please sign in to comment.