Jump to content

Beauford

Members
  • Posts

    103
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Beauford's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I have a DB with two tables, customers and orders. One customer may have many orders, What I want to do is do a select on the two tables and get the customer info once, and then all the orders associated with the account. I saw how to do this once before using a join and then having to use a PHP foreach to break it up. I am just not sure of how to put the two together to make it work, or maybe there is an easier way completely. Any help is appreciated. Thanks B Example: Bob Smith Shoes Coat Boots Gloves Sally Jones Hat Purse Boots Umbrella
  2. Got it. Thanks. No sure what exactly was confusing me, but for some reason I was thinking natsort($array); needed to be assigned to another array or something. I wasn't thinking I could just use it as shown below. natsort($array); $num = implode("",$array); I was almost there in my first post, but the manual just made it more confusing. $test = natsort($array); $num = implode("",$test);
  3. I appreciate the effort to explain this, but I still don't see how I can use this to solve my problem - if it actually can be. The examples are useless and doesn't show me how it applies to what I want to do. If all I can do with this is use print_r it makes no sense to me. Sorry if I making this harder than it is, but just not getting this. I need a sorted array that I can use just like the original unsorted one. Thanks
  4. Maybe you should read our posts more closely, because no one told you it doesn't work, we said you aren't using it properly, hence the manual suggestion. natsort() is perfect in this case. How is it perfect? Is reading the manual going to tell me this, no it is not. Ane lets get one thing straight, I read the manual - how do you think I even found out about it. Now maybe your seeing something I'm not, but before just blabbing about reading the manual, maybe you should explain why. Not eveyone reads something the same way. I find this more often than not in these forums where people just casually through out the manual crap.
  5. ROFL What is the purpose of me reading the manual, you already told me it doesn't work. Maybe you people should read my posts closer which specifically asked for alternatives to natsort so that I can acheive the desired results.
  6. So the question is then, how do I do it? This to me would have been the proper way of doing things, then how how can someone manipulate the sorted data? Any help on other alternatives would be appreciated. Thanks
  7. Is PHP really this insane? I want to sort an array that has just numbers in it. Then I want to implode the result. $test= natsort($array); $num = implode("",$test); if $array has 5 2 1 3 4 in it then $num should end up looking like this: 1 2 3 4 5. Nope: Warning: implode(): Invalid arguments passed in file.php on line 171 -- If I just implode $array it works fine, but not sorted which is what I want. Beyond me why it doesn't work. Looks perfectly logical to me, so what am I missing??? Thanks
  8. Thanks, this one seems to work best for my needs. if($num = array_search(3, array_count_values($array))) { echo "3 dups of $num\n";}
  9. I have been playing around with array_unique and a couple of other array functions, but can't get the combination of them I need t achieve my goal. Take the following array 3 3 3 4 1. I want to be able to count the duplicates and if the total of duplictes is 3 do something, if not 3 do nothing. 3 3 6 1 8 would be false 5 4 4 4 4 would be false 1 4 1 5 4 would do false 4 6 6 4 6 would be true 1 1 1 4 6 would be true 4 6 4 4 6 would be true Thanks
  10. Not 100% sure what you are asking here. "What is your current form processing code and the code that is retrieving the data from the database?" But when code is imput I use mysql_real_escape_string($var). When I view it I use something like this - stripslashes(htmlentities($var],ENT_QUOTES)) Thanks
  11. magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off
  12. Weird forum. This happened before too when I tried typing a lot of text in a post. The text just bounces all over an you can't see what you are typing. Anyway, any help at all on the original problem is appreciated as it is more than annoying. Thanks
×
×
  • 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.