whelpton Posted March 2, 2011 Share Posted March 2, 2011 Hi guys, essentially, I have very limited knowledge with mysql and have hit a brick wall. The row that I am trying to select is the following: Now, I am trying to use the following script to achieve that: $query = "SELECT meta_value FROM wp_usermeta WHERE user_id='$id' & meta_key='simple_local_avatar'"; The $id is being passed as 1 from a cookie, and I know for sure that thats working properly, but I cant figure out the coding to select it correctly. I need the script to search for the ID of the user & then user the simple_user_avatar to find the right entry. Please someone cast your knowledge and help me out! Oh, little adendum. All that happens when the script runs is that the first row of the table is called out, which is: Quote Link to comment Share on other sites More sharing options...
ZacTopher Posted March 2, 2011 Share Posted March 2, 2011 Tried using AND instead of & in your query? Quote Link to comment Share on other sites More sharing options...
whelpton Posted March 2, 2011 Author Share Posted March 2, 2011 Oh fantastic! Thank you very much, that solved it straight away. Quote Link to comment Share on other sites More sharing options...
ZacTopher Posted March 2, 2011 Share Posted March 2, 2011 You're welcome Quote Link to comment 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.