Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 40 additions & 29 deletions php/binary_data/user-1.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
<?php
public function saveUserDatav2() {
parent::connect_to_database("localhost", "barreto", "sTovok0r", "movieCollection");
$queryStr = "INSERT INTO 'users'('userID', 'fname', 'lname', 'pic')"."VALUES (NULL, '".$this->fname."', '".$this->lname."', '".$this->profilePic."')";
echo $queryStr;
$result = parent::executeQuery($queryStr);
if ($result === TRUE) {
$uid = parent::returnLastRecordID();
$success = $uid;
} else {
$success = FALSE;
}
class users extends database {
public $fname;
public $lname;
public $profilePic;
public $email;
public $password;
public $userid;

parent::disconnect_from_database();
return $success;
}
public function saveUserDatav2() {
parent::connect_to_database("localhost", "barreto", "sTovok0r", "movieCollection");
$queryStr = "INSERT INTO `users` (`userID`, `fname`, `lname`, `pic`) VALUES (NULL, ?, ?, ?)";
$params = [$this->fname, $this->lname, $this->profilePic];
$result = parent::executeQuery($queryStr, $params);

public function getRecordById($myid) {
parent::connect_to_database("localhost", "barreto", "sTovok0r", "movieCollection");
$queryStr = "SELECT * FROM 'users' WHERE 'userID' = ".$myid;
parent::executeQuery($queryStr);
$profileInfo = parent::getResultSet();
$this->userid = $profileInfo['userID'];
$this->fname = $profileInfo['fname'];
$this->lname = $profileInfo['lname'];
$this->profilePic = $profileInfo['pic'];
$this->email = $profileInfo['email'];
$this->password = crypt($profileInfo['password'],"sdjeyrfgdb4334");
parent::disconnect_from_database();
}
if ($result === TRUE) {
$uid = parent::returnLastRecordID();
$success = $uid;
} else {
$success = FALSE;
}

parent::disconnect_from_database();
return $success;
}

public function getRecordById($myid) {
parent::connect_to_database("localhost", "barreto", "sTovok0r", "movieCollection");
$queryStr = "SELECT * FROM `users` WHERE `userID` = ?";
$params = [$myid];
parent::executeQuery($queryStr, $params);
$profileInfo = parent::getResultSet();
$this->userid = $profileInfo['userID'];
$this->fname = $profileInfo['fname'];
$this->lname = $profileInfo['lname'];
$this->profilePic = $profileInfo['pic'];
$this->email = $profileInfo['email'];
$this->password = crypt($profileInfo['password'],"sdjeyrfgdb4334");
parent::disconnect_from_database();
}

// Getter methods from the users class

Expand All @@ -47,7 +57,8 @@ public function getEmail() {
return $this->email;
}

public function getPassword() {
return $this->password;
public function getPassword() {
return $this->password;
}
}
?>