Skip to content

Commit

Permalink
Updated: Checks for existence of mysqldump before dumping.
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@148 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 25, 2003
1 parent 9b6224f commit c4c1f3c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions admin/resultsdump.php
Expand Up @@ -45,8 +45,20 @@
}

$filename="survey_{$sid}_dump.sql";
$mysqldump="$mysqlbin/mysqldump";
if (substr($OS, 0, 3) == "WIN") {$mysqldump .= ".exe";}
//Check that $mysqlbin/mysqldump actually exists
if (!file_exists($mysqldump))
{
echo "$setfont<center><b><font color='red'>ERROR:</font></b><br />\n";
echo "Cannot find mysqldump file. ($mysqldump)<br /><br />\n";
echo "If this script is running on a Windows Server, you should uncomment the \$mysqlbin line in config.php<br /><br />\n";
echo "<a href='browse.php?sid=$sid'>Back to browse</a></center>";
exit;
}

$command="$mysqlbin/mysqldump -u $databaseuser --password=$databasepass $databasename survey_$sid > $filename";

$backup = popen("$command","r");
pclose($backup);

Expand Down

0 comments on commit c4c1f3c

Please sign in to comment.