Jump to content

Beauford

Members
  • Posts

    103
  • Joined

  • Last visited

    Never

Everything posted by Beauford

  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
  13. I have spent many an hour trying to understand this apostophe problem and escape strings, etc. etc. and thought I had it figured out - well, I guess I didn't. I changed hosting servers yesterday, and copied everything to the new server - no code was changed but now I have the same problem as I did before. Whenever someone places an apostrophe in an form input, the output shows a \ before the apostrophe. So what could possibly be different in PHP or MySQL that I can change so it works like it did on the old server. I know this is a broad question but I just don't get what could be different. I don't understand this escape crap, htmlentities, and addslashes, and whatever else to start with and spent litterly hours on end getting it to work, just to have it fall apart on another server. Any help is appreciated, I have to cut this short as this forum is acting up as well and is bouncing all over the place.
  14. Because of the amount of posts, it's impossible to find your post after even one day. Doing a search on my user name does nothing, and unless you know exactly what you wrote there is no way to search for it. There should be a way to see what I have posted, a history if you will. But like now, I will just move on and post to another board as I don't have time to be trying to figure out where my post is.
  15. How can I find if the current time is between a predetermined time. ex: How would I find if 4:52a is > midnight and < 6am I need 4 of these checks, one every 6 hours: midnight to 6a, 6a to 12p, 12p to 6pm, 6pm to midnight. Thanks
  16. I am using mysql_real_escape_string when I input text and have tried a variety of ways when trying to display it. The biggest problem is whenever a user tries to edit their post, anything after an apostrophe is missing, I have tried stripslashes(htmlentities($_POST['stuff'],ENT_QUOTES)) or just stripslashes, or just htmlentities. What am I doing wrong, this can't be this complicated???????? Thanks
  17. I'm going to take one last stab at this to see if anyone knows how to get this working. I am at my wits end with this and will have no choice but to dump PHP and MySQL and see if there is something else that actually works with out all the cloack and dagger. I have spent the last two days on this, over 20 hours and I'm nowhere. Simply put, I want things that go into the database to display the same when I retrieve them. The biggest problem I have is an apostrophe, which just seems so stupid wasting this much time for one character. Finish in next post. LOL
  18. This is the most ridiculous thing I have ever seen. Now my BBCodes don't work and apostophes are all screwed up. I can't believe you have to jump though hoops just to get something to display the way it should. It Just amazes me. Does anyone have any ideas, or should I just start looking for a language that does this by default, which it should in the first place. Just a little frustrated with this as it's been months trying to get everything to work right. Thanks
  19. I have a form where users enter info. I have a user with a username that's supposed to looks like this: ΠIGHTMΛΓΣZ BΛY BΛY® When I display it it looks like this: Î IGHTMÎ�Î�ΣZ BÎ�Y BÎ�Y® I am inserting it into the Mysql DB with this: $msg = htmlspecialchars(mysql_real_escape_string($_POST['message']), ENT_QUOTES); When retrieving and displaying it I use: $message = nl2br($r['mail_text']); Can someone set me straight on this at it has been causing me nightmares for quite some time, this is just the latest in a line of problems with trying to display things properly. Thanks
  20. Even some pointers to a couple of good websites would be great. Every query I do I get pages and pages of how to make a login script. Not what I need. Thanks
  21. Is there a way with PHP to protect my MySQL database info in my PHP scripts, or is this more of a Linux .htaccess or permissiong thing I would need to do? Thanks B
×
×
  • 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.