Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Since you're sending a raw query, you can at least make just one query instead of many. First, query just wordpress (using RAW SQL) to get all of your IDs and put them in an array. Then use IN to put them in your other system's query.
  2. '$tempdate' is a literal string, reading $tempdate. Not the variable contained within $tempdate.
  3. 1. On your main page, where is $c_id defined? Post that page's relevant code. 2. <?php echo ".urlencode($c_id)." ?> will echo a string containing .urlencode(whatever cid was). You don't want those quotes or .s. Bad.
  4. Echo the query to see if it has the same ID each time or a different ID each time. Really you should write one query to join these tables, if you want to do it the right way, post the tables structures and someone can help you write a JOIN to get all the data the right way.
  5. See the link in my signature about debugging SQL. As well as the others about getting help.
  6. Ok, turn the fancy editor off by clicking the toggle switch, and try that again. But: foreach ($response->records as $record) { $Name = $record->{Name}; $Phone = $record->{Phone}; $BillingCity = $record->{BillingCity}; $BillingState = $record->{BillingState}; } echo $Name; echo $BillingCity; echo $BillingState; ?> If you don't echo them until after your foreach() loop, you will only ever see the last set.
  7. Yes, you can add it to the URL.
  8. Clearly I'm wrong since your code works so perfectly. Good luck.
  9. Edit: with table aliases you don't use AS. Just column Aliases.
  10. I think with a sub select you leave out the "AS"
  11. Okay you're not posting the ID at all, so $_POST['id'] isn't set. You need a hidden input with the posts id.
  12. So, did you bother to read what I said? That's what I get for attempting to be gentle with people. Ignored. Post the relevant code if you want help. Describe your problem.
  13. You can't have two WHERE clauses. You can use AND.
  14. It must be other code on the page. You still need to enable error reporting.
  15. And if that isn't it then do a print_r on the 3 arrays
  16. In array intersect I think you want to switch the order of your arguments.
  17. No offense, but no one wants to look through all of your "too many" files to find your bug. You need to post just the relevant code, and describe the problem besides "it's wrong".
  18. You've been a member of this forum for TEN YEARS and haven't learned to post in the right forum, and you want us to keep doing it for you without complaining? In other words, you've been a member here LONGER THAN I HAVE and you haven't figured out the difference between the PHP help forum and the Regex help forum, and you're upset that someone told you so? PS: Questions end in question marks. If that is your only question, don't hide it in the middle of a list of code.
  19. The <> icon. http://php.net/manual/de/language.types.array.php
  20. 1. This is the wrong forum, I'm moving your post. 2. Use code tags on your code. 3. Put quotes around your strings. 4. Check if the form has been posted before trying to use the $_POST array.
  21. If you don't see PHP errors, you need to enable error_reporting, set to E_ALL. Table names should not be strings either. If you're having trouble appending them do it outside of the SQL in a separate string, but this should work: $sql = "SELECT initiator_user_id FROM {$wpdb->prefix}bp_friends WHERE friends_user_id = $k_user_id AND is_confirmed = 1"; $k_friends1 = $wpdb->get_col($sql); If I understand what you're trying to do, this should do it. $sql = "SELECT IF((initiator_user_id = $k_user_id), friends_user_id, initiator_user_id) AS friend_id FROM {$wpdb->prefix}bp_friends WHERE (friends_user_id = $k_user_id OR initiator_user_id = $k_user_id) AND is_confirmed = 1"; Will get you one array of everyone who is a friend to $k_user_id. For the final part "removing any values not contained in either of the two SQL queries" array_intersect should work.
  22. In the future you need to post the error you get as well as your code. if(!in_array($x, $k_friends, TRUE) { - You're missing a closing parenthesis. Also in SQL you shouldn't put quotes around column names. 'bp_friends' makes it a string, and causes an error. ALSO - Your're doing 2 queries when you have absolutely no need to. All of this logic could be done in one query.
  23. No, you don't. This is very simple. Going back and reading your original post it's very clear. What you need to do is add a hidden input with the row's ID in it. Now you know what row you're trying to submit. End of story. (Each row needs to have it's own form, btw.)
×
×
  • 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.