Jump to content
MakeWebGames

Nothing Here


URBANZ

Recommended Posts

9 hours ago, urbanmafia said:

im playing around with the classes currently and changing them. For the stats ive decided to just go with this to save editing it all the time

public function getStats() { $stmt = $this->db->prepare("SELECT * FROM user_stats WHERE US_id = (:id) LIMIT 1"); $stmt->bindParam(":id", $this->id, PDO::PARAM_INT); if($stmt->execute()): if($stmt->rowCount() > 0): $result = $stmt->fetch(); endif; endif; return $result; }


public function getStats()
{
	$stmt = $this->db->prepare("SELECT * FROM user_stats WHERE US_id = (:id) LIMIT 1");
    $stmt->bindParam(":id", $this->id, PDO::PARAM_INT);
		
	if($stmt->execute()):
    	if($stmt->rowCount() > 0):
		$result = $stmt->fetch();
        endif;
    endif;
  return $result;
}

 

Ok, I see what you are doing there. One more recommendation:

You should return a result if nothing is found for whatever reason. If there isn’t any rows, it returns absolutely nothing at all because $result is only defined if there are rows found

Link to comment
Share on other sites

41 minutes ago, urbanmafia said:

Thankyou dave for the offer im currently hosting it on my dedicated server might be a good idea to host it here after it is completed. The demo should be released around Wednesday after the base is all finished.

Okay great! You do whatever you thinks best, excited to see it.

Will it be open source?

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...