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: Link to comment https://forums.phpfreaks.com/topic/229410-selecting-certain-mysql-row/ 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? Link to comment https://forums.phpfreaks.com/topic/229410-selecting-certain-mysql-row/#findComment-1181997 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. Link to comment https://forums.phpfreaks.com/topic/229410-selecting-certain-mysql-row/#findComment-1181999 Share on other sites More sharing options...
ZacTopher Posted March 2, 2011 Share Posted March 2, 2011 You're welcome Link to comment https://forums.phpfreaks.com/topic/229410-selecting-certain-mysql-row/#findComment-1182000 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.