eyalrosen123rulezz Posted October 21, 2007 Share Posted October 21, 2007 Hi everyone! How can I do something like this? mysql_query("update bla set value='$_array['daniel']' where bla='x'") Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/74199-very-simple-question-writing-arrays-syntax/ Share on other sites More sharing options...
Ninjakreborn Posted October 21, 2007 Share Posted October 21, 2007 Yes, you can. However, you need to redo the way you are putting it in. Do this... mysql_query("update bla set value='" . $_array['daniel'] . "' where bla='x'") That should work fine for you. However if you have problems just set that array value into it's own variable and use it that way. Either way you can make it happen. Quote Link to comment https://forums.phpfreaks.com/topic/74199-very-simple-question-writing-arrays-syntax/#findComment-374767 Share on other sites More sharing options...
Barand Posted October 21, 2007 Share Posted October 21, 2007 or, use curlies when placing array vars in strings mysql_query("update bla set value='{$_array['daniel']}' where bla='x'") Quote Link to comment https://forums.phpfreaks.com/topic/74199-very-simple-question-writing-arrays-syntax/#findComment-374781 Share on other sites More sharing options...
eyalrosen123rulezz Posted October 21, 2007 Author Share Posted October 21, 2007 Thanks! Your helped me alot! Quote Link to comment https://forums.phpfreaks.com/topic/74199-very-simple-question-writing-arrays-syntax/#findComment-374787 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.