elis Posted September 22, 2008 Share Posted September 22, 2008 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.) Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted September 22, 2008 Share Posted September 22, 2008 What is ":cid"? I don't know why your putting a colon in there, I think you mean for it to be "$cid". Quote Link to comment Share on other sites More sharing options...
elis Posted September 22, 2008 Author Share Posted September 22, 2008 Colons are used for prepared statements. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.