Add better debug messages to output

This commit is contained in:
james 2011-03-03 23:14:52 +00:00
parent 4c15b72a8b
commit c87f23397f
2 changed files with 10 additions and 9 deletions

View File

@ -378,9 +378,9 @@ switch($request[0]) {
$p = getProject($u['id']);
if(is_array($p)) {
$_SESSION['registration_id'] = $p['registrations_id'];
$_SESSION['registration_number'] = $p['num'];
$_SESSION['registration_number'] = $p['registration_number'];
}else
$_SESSION['error'] = "project not found";
$_SESSION['error'] = "project not found: $p";
}
else{

View File

@ -285,9 +285,8 @@ function saveProjectData($data,$registrations_id=null){
*/
}else{
//first, lets make sure this project really does belong to them
$qstr="SELECT * FROM projects WHERE id='" . $data['project_id'] . "' AND registrations_id='" . $rid . "' AND conferences_id='" . $conference['id'] . "'";
$q = mysql_query("SELECT * FROM projects WHERE id='" . $data['project_id'] . "' AND registrations_id='" . $rid . "' AND conferences_id='" . $conference['id'] . "'");
$q = mysql_query($qstr);
if(mysql_num_rows($q) == 1) {
$summarywords = preg_split("/[\s,]+/", $data['summary']);
$summarywordcount = count($summarywords);
@ -380,7 +379,7 @@ function saveProjectData($data,$registrations_id=null){
}
}
else {
$message = i18n("Invalid project to update");
$message = i18n("Invalid project to update: %1",array($qstr));
}
}
return $message;
@ -518,8 +517,8 @@ function saveRegistrationData($d) {
function getProject($userId){
global $conference;
$userid = intval($userId);
$result = mysql_fetch_assoc(mysql_query("SELECT registrations_id FROM users WHERE id = $userId"));
$userId = intval($userId);
$result = mysql_fetch_assoc(mysql_query("SELECT registrations_id FROM users WHERE id='$userId'"));
if(!is_array($result)){
return "register_participants.inc.php::getProject -> User not found";
}
@ -541,9 +540,11 @@ function getProject($userId){
));
$q = mysql_query("SELECT $fields FROM projects
JOIN registrations ON registrations.id = projects.registrations_id
WHERE projects.registrations_id='$regId' AND projects.conferences_id='".$conference['id']."' LIMIT 1");
WHERE projects.registrations_id='$regId'
AND projects.conferences_id='".$conference['id']."'
LIMIT 1");
if(mysql_error()) {
$returnval = "register_participants.inc.php::getProject -> " . $returnval;
return "register_participants.inc.php::getProject -> " . $mysql_error();
}else{
$returnval = mysql_fetch_assoc($q);
}