doubledee — 2012-01-08T22:07:18-05:00 — #1
If I place text after the question mark in my Prepared Statement, will it cause any issues?
// Build query.
$q2 = 'SELECT m.first_name, c.created_on, c.body, c.status
FROM member AS m
INNER JOIN comment AS c
ON m.id = c.member_id
WHERE c.article_id=?[B] <font color='"#FF0000"'>AND c.status="Approved"';</font>[/B]
r937 — 2012-01-09T00:27:03-05:00 — #2
you're asking a php question in the mysql forum again
i would just sidestep the issue by coding it this way --
WHERE c.status="Approved" AND c.article_id=?';
doubledee — 2012-01-09T00:46:37-05:00 — #3
Sure, why not be obvious?!
anthonysterling — 2012-01-09T03:51:38-05:00 — #4
immerse — 2012-01-09T05:15:13-05:00 — #5
As Anthony said, no, it doesn't matter at all. After all, what if you have a prepared statement with two parameters? Then you'll always have text after the first question mark.
But did you not try to run the above query before asking your question here?
doubledee — 2012-01-09T13:15:35-05:00 — #6
Yes I did.
(Doesn't mean what I did was correct.)