Created
April 13, 2011 21:48
-
-
Save weatheredwatcher/918502 to your computer and use it in GitHub Desktop.
puts alere survey results into alere dataset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('includes/db.inc.php'); | |
$results = mysql_query('SELECT ID, Alere_PID FROM qcl.alere'); | |
while($row = mysql_fetch_assoc($results)){ | |
$current_pid = $row['Alere_PID']; | |
$pid_results = mysql_query("SELECT Question, Answer FROM qcl.alere_results WHERE PID = '$current_pid'"); | |
while($pid_row = mysql_fetch_row($pid_results)){ | |
$question = $pid_row[0]; | |
$answer = $pid_row[1]; | |
$query = "UPDATE qcl.alere SET $question = '$answer' WHERE Alere_PID = '$current_pid'"; | |
mysql_query($query) or die(mysql_error()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment