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
https://forums.phpfreaks.com/topic/125333-spot-the-problem-sql-grab-failing/
Share on other sites

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.