Ken2k7 Posted August 23, 2007 Share Posted August 23, 2007 Is it mandatory to have the quotes in the UPDATE query as shown below: mysql_query("UPDATE member SET name='$name', age='$age', location='$loc', sex='$sex', interests='$interests' WHERE id='$id'"); or can I do this: mysql_query("UPDATE member SET name=$name, age=$age, location=$loc, sex=$sex, interests=$interests WHERE id=$id"); Thanks in advance. I would've tested myself but this requires another php file that I haven't created yet, so that's why I'm asking. It's like a mini-project. Link to comment https://forums.phpfreaks.com/topic/66298-solved-update-quote/ Share on other sites More sharing options...
matthewhaworth Posted August 23, 2007 Share Posted August 23, 2007 I think SQL is lenient and will allow it without quotes, but if it's a string, it should have quotes. Link to comment https://forums.phpfreaks.com/topic/66298-solved-update-quote/#findComment-331657 Share on other sites More sharing options...
vijayfreaks Posted August 23, 2007 Share Posted August 23, 2007 Hi.. if its int,float then its ok.. but if its string then ur data contain , or anything junk sql injection then you will have error or there would be problem in data.. Regards, Vijay Link to comment https://forums.phpfreaks.com/topic/66298-solved-update-quote/#findComment-331679 Share on other sites More sharing options...
matthewhaworth Posted August 23, 2007 Share Posted August 23, 2007 Hi.. if its int,float then its ok.. but if its string then ur data contain , or anything junk sql injection then you will have error or there would be problem in data.. Regards, Vijay You like to come in threads and repeat what I say don't yer lol. Link to comment https://forums.phpfreaks.com/topic/66298-solved-update-quote/#findComment-331680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.