Knowledgebase
Hi, PHP and MySQL question
Posted by mr5, 09-21-2007, 03:59 PM | Hi,
I have tried to search on the Internet but I've not found the answer yet.
MySQL table
mytable
+----------------------+
|id | 1
+----------------------+
|check_num | 1,2,3 | (varchar: 100)
+----------------------+
Task: I want to select the id
This doesn't work:
But this works
Could you please tell me when I should input single quotes?
Thanks in advance.
|
Posted by Maxo, 09-21-2007, 04:12 PM | I am not a programmer, but seems like $num is variable in your case and you should not put it in quotes.
Follow this link, you might find interesting information regarding quotes:
http://www.helioza.com/Directory/Com...-Strings-1.php
|
Posted by mr5, 09-21-2007, 05:13 PM | thanks Maxo. However, I think putting quotes in the MYSQL statement is a good idea for security purpose. In addition, I even don't receive the id value with this statement:
but this works:
|
|
Add to Favourites
Print this Article |
Also Read