Jump to content

Spring

Members
  • Posts

    224
  • Joined

  • Last visited

Everything posted by Spring

  1. Spring

    Advice

    Normalize the tables as Pandemikk said. I have done so.
  2. Spring

    Advice

    Actually yes. I hope you're referring to the normalization. Besides, the LIKE %33% isn't quite right. What do you suggest rather than LIKE %33%
  3. Spring

    Advice

    Appreciate it! This isn't my table, I'm working with an old script so any advice helps!
  4. Spring

    Advice

    my table has id, user_id, User_item_ids and User_item_shop_id Is that bad? And I'll try what you've suggested.
  5. Spring

    Advice

    So here's my problem I'm not sure how to approach this: I have a table with user_items which are stored together separated by commas. 13,12,11,9,27,15,16,22,21,23,24,26,29,30,31,32,33 Now, I have a script where the user is in a trade and I want to verify the item they are trying to trade, but is there an alternative other than grabbing all of that users' items and checking that one item with all of the records? I've tried using SELECT * FROM MYTABLE WHERE user_item_id IN(33) As an example to see if it will pull the rows with that ID. It didn't seem to work, am I doing it wrong? if so, forgive me. Any suggestions/help? The main problem is I don't want to have to explode that data and use a foreach to check that one item against all of that users items, as they could have well over 500.
  6. DOH! I found out the small mistake I made, sorry for wasting anyone's time.
  7. No. MD5 is just outdated. Add salt. http://www.phpfreaks.com/forums/index.php?topic=254277.0
  8. function getCategoryName($cRow[0]) you don't call a function like that.
  9. Looks correct to me, you can try this if you want. $("input").live("click", function(){ $(this).addClass("focus"); }); Also there could be another part of your Jquery incorrect that's breaking the script.
  10. You'd grab the user data from and unique ID and output that data on a page depending on the ID. There's no reason to actually create separate pages for each user.
  11. Post the code if you want help.
  12. Mind posting the whole code?
  13. overflow: auto; Maybe?
  14. Any errors? error_reporting(E_ALL); ini_set('display_errors', '1'); Maybe it's your permissions?
  15. Ok. $target = AVATAR_UPLOADPATH; What is AVATAR_UPLOADPATH; set to then? Ah I see it.. So..where is this file located? Is it in the root directory?
  16. What's the problem though? What error are you getting with yours?
  17. Did 'ya set up the DB connect correctly? Where is $dbc defined?
  18. $sql_quest = 'SELECT id, username FROM user ORDER BY id ASC LIMIT '. $my_int_value . ',' . $my_int_value + 30'; How's this? Are you getting an error? Can 'ya post it?
  19. Then why does it extend the CI_Controller ? That's the fix that I made, but while I have you I do have another problem.. This code is almost directly from the user_guide find on the website, but my CI doesn't recognize the library..Am I better off asking on the CI forums? Or do you think you can give it a go? The error is the same as above. $config['image_library'] = 'gd2'; $config['source_image'] = '/ci/images/port/threechan.png'; $config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['width'] = 75; $config['height'] = 50; $this->load->library('image_lib', $config); echo $this->image_lib->resize(); Jesus never, I'm just not going to program late night, thank you.
  20. I got it working correctly now! For someone reason, the array didn't have the right keys..anyway, $sql = 'select * from MYTABLE where item_id IN ('.$items.') AND item_tab = "'.$tab_id.'" AND `item_pose` = 0'; Worked fine!
  21. Highly appreciate the MySQL IN syntax. I have never used it before. I'll try these out and update you accordingly.
  22. Well, In my DB i have user items as follows: 13,12,11,9,27,15,16,22,21,23,24,26,29,30,31,32,33 Each ID is a user item that has been imploded to be sent to the DB. Well, I', trying to take them out of the DB now, and I'm having a small problem turning them back into integers. Here's what I've done. $items = explode(",", $row['user_item_id']); So I get: 0 => string '13' (length=2) 1 => string '12' (length=2) 2 => string '11' (length=2) 3 => string '9' (length=1) 4 => string '27' (length=2) 5 => string '15' (length=2) 6 => string '16' (length=2) 7 => string '22' (length=2) 8 => string '21' (length=2) 9 => string '23' (length=2) 10 => string '24' (length=2) 11 => string '26' (length=2) 12 => string '29' (length=2) 13 => string '30' (length=2) 14 => string '31' (length=2) 15 => string '32' (length=2) 16 => string '33' (length=2) Then I do this: foreach($items as $item){ var_dump($item); $sql = 'SELECT * FROM `MYTABLE` WHERE item_tab = '.$tab_id.' AND item_id = '.$item.' AND item_pose =0'; } and get this: string '13' (length=2) string '12' (length=2) string '11' (length=2) string '9' (length=1) string '27' (length=2) string '15' (length=2) string '16' (length=2) string '22' (length=2) string '21' (length=2) string '23' (length=2) string '24' (length=2) string '26' (length=2) string '29' (length=2) string '30' (length=2) string '31' (length=2) string '32' (length=2) string '33' (length=2) Now, this works how I want it to except, I want a integer value not a string. What would be the best way to approach this?
  23. I love the design.
  24. Well, I'm officially confused. Going to hand this over to someone else.
  25. The entire page is blank?
×
×
  • 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.