clinton_pillay Posted October 14, 2019 Share Posted October 14, 2019 Hi experts. I am received a GET variable into a page which is a id with a value as uuid:3242_2323_4444_9909_433/child_repeat[1]. Which is being used in my mysql query. So my query will be SELECT * from table_1 WHERE id = $id. However php is treating this string differently, my query fails, it says that it has a error near :3242_2323_4444_9909_433/child_repeat[1]. So it seems that its interpreting the colon as something else and removing the text before the colon. Quote Link to comment https://forums.phpfreaks.com/topic/309371-php-special-characters-help/ Share on other sites More sharing options...
ginerjm Posted October 14, 2019 Share Posted October 14, 2019 (edited) Probably need quotes around the value. Of course, the proper way to write your query is to NOT use the * but rather specify the column names (fields) that you want to retrieve. $q = "select * from table_1 where id='$id'"; Edited October 14, 2019 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/309371-php-special-characters-help/#findComment-1570640 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.