Jump to content

[SOLVED] T_CONSTANT_ESCAPED_STRING


Link

Recommended Posts

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/www/html/includes/classes/JournalJuly.class.php on line 57

 

I can't find it.  Can you?

 

<?php
require_once $_SERVER['DOCUMENT_ROOT']."/includes/config.inc.php";
require_once $_SERVER['DOCUMENT_ROOT']."/includes/db.inc.php";
require_once $_SERVER['DOCUMENT_ROOT']."/includes/classes/Journal.class.php";
require_once $_SERVER['DOCUMENT_ROOT']."/includes/classes/User.class.php";

$user = new User();


class JournalJuly extends Journal {

public function JournalJuly() {
	parent::setMonth("july");
}

public function exists($id) {
	global $_CONFIG;
	dbConnect();
	$q = "SELECT * FROM ".$_CONFIG['journal_july_database_table']." WHERE user_id=".checkQuery($id);
	if (mysql_num_rows(mysql_query($q)) == 1) return true;
	else return false;
}

public function setJournal($id, $arr) {
	global $_CONFIG;
	if ($this->exists($id)) {
		$q = "UPDATE ".$_CONFIG['journal_july_database_table']." SET 
			supervisor=".checkQuery($arr['supervisor']).",
			team=".checkQuery($arr['team']).",
			teammembers=".checkQuery($arr['teammembers']).",
			teamrole=".checkQuery($arr['teamrole']).",
			leader=".checkQuery($arr['leader']).",
			oral=".checkQuery($arr['oral']).",
			written=".checkQuery($arr['written']).",
			others=".checkQuery($arr['others']).",
			dilemma=".checkQuery($arr['dilemma']).",
			policy=".checkQuery($arr['policy']).",
			action=".checkQuery($arr['action']).",
			timestamp=".checkQuery(time())."
			WHERE user_id=".checkQuery($id);

	} else {
		$q = "INSERT INTO ".$_CONFIG['journal_july_database_table']." SET 
			user_id=".checkQuery($id).",
			supervisor=".checkQuery($arr['supervisor']).",
			team=".checkQuery($arr['team']).",
			teammembers=".checkQuery($arr['teammembers']).",
			teamrole=".checkQuery($arr['teamrole']).",
			leader=".checkQuery($arr['leader']).",
			oral=".checkQuery($arr['oral']).",
			written=".checkQuery($arr['written']).",
			others=".checkQuery($arr['others']).",
			dilemma=".checkQuery($arr['dilemma']).",
			policy=".checkQuery($arr['policy']).",
			action=".checkQuery($arr['action']).",
			timestamp=".checkQuery(time());
	}

	$user = new User();
	if ($user->studentInfoExists($id)) {
		$q2 = "UPDATE ".$_CONFIG['student_info_database_table']." SET
			company_name=".checkQuery($arr['company_name'])",
			supervisor_name=".checkQuery($arr['supervisor_name'])",
			project_description=".checkQuery($arr['project_description'])."
			WHERE user_id=".checkQuery($id);
	} else {
		$q2 = "UPDATE ".$_CONFIG['student_info_database_table']." SET
			company_name=".checkQuery($arr['company_name'])",
			supervisor_name=".checkQuery($arr['supervisor_name'])",
			project_description=".checkQuery($arr['project_description']).",
			user_id=".checkQuery($id);
	}

	if (mysql_query($q) && mysql_query($q2)) return true;
	else return false;
}

function getJournal($id) {
	global $_CONFIG;
	$q = "SELECT * FROM ".$_CONFIG['journal_july_database_table']." WHERE user_id=".checkQuery($id);
	if ($info = mysql_fetch_array(mysql_query($q))) {
		$user = new User();
		$student = $user->getStudentInfo($id);
		foreach ($student as $key=>$val) $info[$key] = $val;
		return $info;
	}
	else return false;
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/116412-solved-t_constant_escaped_string/
Share on other sites

<?php
if ($user->studentInfoExists($id)) {
		$q2 = "UPDATE ".$_CONFIG['student_info_database_table']." SET
			company_name=".checkQuery($arr['company_name']).",
			supervisor_name=".checkQuery($arr['supervisor_name']).",
			project_description=".checkQuery($arr['project_description'])."
			WHERE user_id=".checkQuery($id);
	} else {
		$q2 = "UPDATE ".$_CONFIG['student_info_database_table']." SET
			company_name=".checkQuery($arr['company_name']).",
			supervisor_name=".checkQuery($arr['supervisor_name']).",
			project_description=".checkQuery($arr['project_description']).",
			user_id=".checkQuery($id);
	}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.