PHP PDO MySQL INSERT

Closed
jcdfr Posts 15 Registration date Wednesday April 2, 2014 Status Member Last seen July 12, 2014 - Jul 11, 2014 at 06:50 PM
 Blocked Profile - Jul 11, 2014 at 07:28 PM
Hi PHP Gurus, being a newbie I have a simple and mundane question for you, but the answer evades me. I thought that my query was good but it doesnt work.

$quer2 = $dbo -> prepare("INSERT into faq_headers(faq_id,faq_class,faq_catid,faq_subcatid,faq_subcat2,faq_heading,faq_question,faq_answer,faq_poster,faq_date) VALUES(NULL,:faq_class,:faq_catid,:faq_subcatid,:faq_subcat2,:faq_heading,:faq_question,:faq_answer,:faq_poster,CURRENT_TIMESTAMP)");
$quer2 ->bindParam(':faq_class', $fileclass);
$quer2 ->bindParam(':faq_catid', $catid);
$quer2 ->bindParam(':faq_subcatid', $subcatid);
$quer2 ->bindParam(':faq_subcat2', $subcat2);
$quer2 ->bindParam(':faq_heading', $faq_heading);
$quer2 ->bindParam(':faq_question', $faq_question);
$quer2 ->bindParam(':faq_answer', $faq_answer);
$quer2 ->bindParam(':faq_poster', $faq_poster);
$quer2->execute();


for info my DB details are:

faq_id int(5) AUTO_INCREMENT
faq_class varchar(15)
faq_catid int(5)
faq_subcatid int(5)
faq_subcat2 varchar(25)
faq_heading varchar(50)
faq_question varchar(100)
faq_answer varchar(255)
faq_poster varchar(25)
faq_date timestamp CURRENT_TIMESTAMP

1 response

Blocked Profile
Jul 11, 2014 at 07:28 PM
So, hang in there. What error does it produce? Post a query that works, please.

DO you have debug step in your program to see where your code is failing? You know, the screen post that you REM out when you go into production!
0