Jump to content

Jim R

Members
  • Posts

    988
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jim R

  1. "AND" produced zero results. "OR" produced 201. It should be closer to 19 or so. They have to be of the same user_id. One row is noting what subscription level they have. The other tells what county they live in.
  2. I'd like the two relevant rows of data for each ID that it applies to.
  3. Uhm...I do like to think. The rows pulled have to have the same user_id. They don't.
  4. I tried it. It pulled a number of rows that don't have the s2member_level value.
  5. I'm not sure yet what that gave me. It appeared to pull anything with wp_capabilities, whether if it had s2member_level or not.
  6. Yeah...both rows of data for each user that met the criteria.
  7. Instead of 19 rows of data, it produced 1775 rows of data.
  8. Not sure what excluding it will do. I need all that information linked to the user_id.
  9. I didn't say I was surprised. I asked how do I go about querying that data. @Scootstah, I've never really had too many problems with it beyond just lacking a deeper knowledge of how to query a database. It's a learning process.
  10. I can't really. It's how WordPress inputs their user information.
  11. Not sure how to go about this, but I haven't been able to get the right query or even know where to look it up. Below are two rows of data. The following query (someone from here helped me with that query) only gives me the bottom of the two rows: SELECT * FROM wp_usermeta WHERE meta_key = "wp_s2member_custom_fields" AND user_id IN (SELECT user_id FROM wp_usermeta WHERE meta_value LIKE "%s2member_level%") How do I get both lines in my query to show up so I can use them?
  12. I'm dealing with data that WordPress creates for Users when they register and subscribe, and to use it for other purposes, I have to wrap my head around serialized data. It's not sinking in well. The below code works well for what I wanted at the time. It takes into consideration where the Subscriber lives (divided up into five areas) and counts how many I have. That is noted by wp_s2member_custom_fields and ANY s2member_level. There are three levels, and I need to actually note how many there are at each Member level. There is another line of data for each user_id meta_key = wp_capabilities meta_value = a:1:{s:15:"s2member_level2";s:1:"1";} $custom = 'SELECT * FROM wp_usermeta WHERE meta_key = "wp_s2member_custom_fields" AND user_id IN (SELECT user_id FROM wp_usermeta WHERE meta_value LIKE "%s2member_level%")'; $c_results = mysql_query($custom); $region = array(); while($line = mysql_fetch_assoc($c_results)) { $meta_value = unserialize($line['meta_value']); $region[$meta_value['county']]++; }; foreach ($region as $key => $value) { echo "Region $key: $value members<br>"; }
  13. That worked. Thanks. And as usual, figuring something out means more work, and that means I'll likely be back in another topic for more help. I do appreciate all the help provided here.
  14. I have a column with a lot of "wp_1_" in them. I want them to just be "wp_". I've backed up my table. Here is the code I'm looking at: UPDATE wp_usermeta SET meta_key LIKE "%wp_%" WHERE meta_key LIKE "%wp_1_%" Is that remotely close?
  15. Crap, that easy enough. UPDATE jwrbloom_hhr.hhr_schools t1 JOIN jwrbloom_hhm.schools t2 ON t1.id = t2.id SET t1.email = t2.email WHERE t2.email IS NOT NULL
  16. I'm hoping writing down my issue will help me find the logic in it. I have two tables in two different databases that are essentially the same. I've updated each separately at different times without remembering I had two of them. Now I'm trying to merge information from the email columns. These are coaching jobs which have changed since last year. There were around 90 changes. I'm trying to move the emails I have in t2 that I don't have in t1. I have NULL cells in both columns, and I don't want to overwrite emails I already have in t1 with NULL cells I have in t2. I need something that Sets t1.email Where t1.email isn't equal to t2.email and t2.email Is Not Null. (I should have done this before I changed the coaches' names. I could have used that as a trigger.) Would that be the logic? I definitely need help with the syntax. UPDATE jwrbloom_hhr.hhr_schools t1 JOIN jwrbloom_hhm.schools t2 ON t1.id = t2.id SET t1.email = t2.email WHERE ??????
  17. I think I figured it out. It may have been a max-size issue with another image.
  18. Hello, I have my left and right margins set at auto for the img tag in the .home-middle-3 class. The image that doesn't appear to be centered is the Boys Club image. http://grassrootsindiana.com/
  19. It doesn't show an error. Here is the page: http://metroindybasketball.com/fall-league-2011/
  20. I mean come on. It's going to be some comma or misplaced period. I"m getting the following error: Line 28 is the WHILE statement. : ( $query = 'SELECT * FROM fallLeague10 WHERE confirm = "y" ORDER BY team,feet DESC,inches DESC,nameLast'; $results = mysql_query($sql) or trigger_error('MySQL error: ' . mysql_error()); $currentTeam = false; while($line = mysql_fetch_assoc($results)) { if($currentTeam != $line['team']) { //Status has changed, display status header $currentStatus = $line['team']; echo '<tr><td colspan="6"><hr></td></tr>'; } echo '<tr> <td></td> <td><b>' . $line['nameFirst'] . ' ' . $line['nameLast'] . '</b></td> <td><center>'. $line['feet'] . '\'' . $line['inches'] . '"</center></td> <td><center>'. $line['grade'] . '</center></td> <td>'. $line['school'] . '</td>'; echo '<td><b>'. $line['college'].'</b></td>'; echo '</tr>';} echo '</tbody></table>';
  21. As usual, it's something stupidly simple, like a typo. hschool instead of school. Thanks for your time guys. Sorry it wasn't even a code issue.
  22. I am understanding. I put the exact code Adam told me to put, and that was what it produced, which is what I posted in the response above.
  23. Even with Adam's code, it produces: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/jwrbloom/public_html/hoosierhoopsmagazine.com/resources/sectional_assignments.php on line 7
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.