Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. I want to delete an element from an array. There does not appear to be a function for it array(1,2,3,4,5,6,7,8,9) Delete number 6 array(1,2,3,4,5,7,8,9) It can be done using unset() but for that you need the keyname and in my case where the keyname is not hardcoded, not very feasable The other way is to use foreach and check every element in that till it hits a match, then use unset but again not feasable as some arrays have 100's of elements, so not keen on that method Any other ideas?
  2. jaymc

    Mysql Tune

    Hate to be a pain here as I know there is a lot on the web about this of which I do read, but having a few problems My dedicated server runs apache and mysql. I have recently converted all tables from MYISAM to innodb, since then I have notice a huge increase in linux SWAP usage, in the past it was always around 20MB, now its between 1gig and 2 gig. Here is the relivent entries in my.cnf OS: Centos 4.4 Mysql: 5.0.54 Php: 5 RAM: 3GB CPU: 2 X opteron 142 I started off with innodb_buffer_pool_size = 2500M, in stages I have decreased that by 500M each time to try and resolve the swap issue but it hasnt made an ounce of difference Hope you can help [mysqld] default-storage_engine = innodb safe-show-database query_cache_limit=1M query_cache_min_res_unit=1024 query_cache_size=96M ## 32MB for every 1GB of RAM query_prealloc_size=65536 query_cache_type=1 thread_cache_size=64 key_buffer=296M ## 128MB for every 1GB of RAM join_buffer=6M max_connect_errors=20 max_allowed_packet=16M table_cache=1800 record_buffer=16M tmp_table_size=64M sort_buffer_size=3M ## 1MB for every 1GB of RAM read_buffer_size=3M ## 1MB for every 1GB of RAM read_rnd_buffer_size=3M ## 1MB for every 1GB of RAM bulk_insert_buffer_size = 8M thread_concurrency=4 ## Number of CPUs x 2 myisam_sort_buffer_size=16M [b]innodb_data_file_path = ibdata1:500M:autoextend innodb_buffer_pool_size = 750M innodb_additional_mem_pool_size = 2M innodb_flush_method = O_DIRECT[/b] [mysql] no-auto-rehash #safe-updates [isamchk] key_buffer=256M sort_buffer=256M read_buffer=256M write_buffer=256M [myisamchk] key_buffer=256M sort_buffer=256M read_buffer=256M write_buffer=256M
  3. <?=$_SESSION['fromID']?> Shorthand version
  4. sorry, i shouldn't have used WAC in my example. I'm using a true mp3, IDE still lost and when running lame from command line it states they 'currently' will be lost so perhaps in a previos version.. they where not?
  5. Yeh I went with LAME, really good However, one big snag, it doesnt carry accross IDE tag info I know you can define it, but in batch convert, not feasble Is there a previous version that does carry accross the IDE tags? Or maybe different software Thanks.
  6. Im looking for some good, free software to convert audio files 1: Must be able to run from command line, e.g convertor --file=song.wav --newext=mp3 --kbps=128 --destination=/home/fred Multiple formats would be good too! thanks!
  7. Excellent.
  8. Does anyone know the answer to the MYSQL issue?
  9. 2: when using mysql IN(), for example WHERE id IN(1,2,3,4) if number 4 is the first id in the table, that will be the first returned when using the likes of mysql_fetch_assoc How can I get mysql to return the results in the order I specify in the IN() clause, so in the case above rows 1,2,3,4 Edit: Can this be moved to MYSQL I answered my php question after posting so edited it out
  10. Edit: Didnt see your bit about having it run to disk only on update etc
  11. jaymc

    [SOLVED] GROUP

    Dam, ok thanks
  12. jaymc

    Memory

    Im going to be building a server, pretty juicy one too with 2 X quad cores and atleast 8GB of memory Question is, do i really need to be using ECC memory. I know most servers use this but its a real pain getting a compatable motherboard and the memory, specially when working to budget Would I really have much of a problem running a 4 web servers on the above spec in a VMWARE enviroment using NON-ECC What things will suffer / improve using either types
  13. Thanks
  14. 4gb is not huge Is it really mysql being slow or mysql hitting bottle knecks? Check to see how apache is doing? Is it maximg out on allowed connections Use innodb for mysql storage engine as this will stop table based locking Pay attention to your big tables as these are the bad boys. Prune dead data you dont need Use cache and I mean your own managed one. For example for a who's online rather than calculate it on every page refresh for every user run a cron job maybe every 3 mins and dump it in a text file. Then just include that You need to look at where the problems are and fix them as there is no trick. Its based on your design and your clients Post more info and we can take it a step further
  15. Thanks
  16. Strange, probably the way php was handling the fullstop, the slash didnt have any effect, infact it probably thought that was part of the filename
  17. jaymc

    [SOLVED] GROUP

    Ok, its for a gallery system You click on a member and it will display there galleries. They may have 1 gallery they may have 20, it displays each of there gallerys. Of course if you click on one of the gallerys it then goes in and displays all the pictures but thats irrelivent The point is and my problem, I want a certain picture displayed for each of the galleries, the image is the one which has the highest value for valid if there where 10 images and I did a GROUP, it would select one of them images by default I want to choose which image is selects as default As well as doing that, as part of image name from the row returned, I also get the gallery name which is the object
  18. jaymc

    [SOLVED] GROUP

    Sure $q = "SELECT count(views) as count, SUM(views) as viewers, gallery, MAX(valid), timestamp FROM gallery WHERE user = 'jamie' GROUP BY gallery"; Or if you mean an example of data returned, well, its not returning the row in that GROUP which has the highest value for valid. Its as if it ignores that altogether
  19. Ha, I was just reading the same page before checking your post, yes its ok I will just use NESTED its no problem Cheers
  20. Ok, can you give me an example of NESTED replaces
  21. Im using replace to cut out various chars However, I need to replace a bunch of chars, but not sure if replce supports this I need to replace the following with NULL . ' " , Can replace take in an array of parameters, for instance, and Im using * as a fake seperator here replace(field_name, ',*'*"*.', '') I need it to work like that if possible, is there syntax for it...
  22. Ok, so I guess that kind of takes care of those type of chars But what if there is a data in the DB for example "FOOTBALL" and they search for "FOOTBALLS" Return is none even though to us they are practically the same I need to loosen it up
  23. Because the apostrophy was just an example A comma could be another, or a fullstop etc Anything that a user would not be fussy about but mysql would I need users to be able to talk to my database humanly, not logically
  24. jaymc

    [SOLVED] GROUP

    There is no error message, it just displays what ever it wants I cant put a MAX around timestamp as that will conflict with the max around valid
  25. jaymc

    [SOLVED] GROUP

    That worked, but not when I put the rest in $querya = "SELECT count(views) as count, SUM(views) as viewers, gallery, timestamp, MAX(valid) FROM gallery WHERE gallery.user = 'peter' GROUP BY gallery";
×
×
  • 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.