Jump to content

Spot the problem? SQL grab failing


elis

Recommended Posts

I have this PHP snippet:

 

<?php $sql = "SELECT resume_id, resume_filename FROM candidateResumes WHERE candidate_id = :cid";
			$stmt2 = $conn->prepare($sql);
			$stmt2->bindParam(':cid', $id);
			$stmt2->execute();
			$resumes = $stmt2->fetchAll();
			$stmt2->closeCursor();

			if($resumes) {
			echo ('available'); }
			else {
			echo ('empty return');}
?>

 

But for some reason, it's returning as if nothing exists. I've checked the MYSQL table that it's pulling from and it does exist, so I'm assuming I have an problem in my syntax.

 

edit: ":cid and $id are variables from a $_GET statement. The entire script (not just this snippet) runs from the same $_GET statement and everything else that operates from it works, so I'm almost certain it's not that.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.