How to use where clause in insert statement in php 5.1.6?
I have a global variable $module and i want to use where clause to distinguish my search result. where module= $module
I keep on getting error saying undefined variable $module
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Without knowing anything about your code, I’d guess your problem is that you don’t escape your $module variable. try surrounding it with {}.Example:
$query = “SELECT * FROM FOOBAR WHERE id = {$module}”;
Edit:
OP posted code on comments.
{} only works if you use quotation marks around your variable.
Change you code to :
Edit2:
Are you actually defining $module somewhere?