Jump to content

bh

Members
  • Posts

    238
  • Joined

  • Last visited

Everything posted by bh

  1. I ran a micro test. In a 20K rows table (id, name): SELECT * FROM xyz LIMIT 19998, 2 ~0.0065s SELECT * FROM xyz ORDER BY id DESC LIMIT 0, 2 0.0002s The 2nd is much faster Your right (And at first, still no the count(*) ) [edit] Its understandable, cuz the ids are in sequence (1, 2, 3... 7, ... almost nothing to order.
  2. @Mchl: yeah, its another solution, but why do you want to order the entire table? if id is a pk thats up to speed, is ok, but i think the counting and then the limit is much lower cost, than your order by.
  3. You have an 1x1 image what do you want to see in your page? You'll see an 1x1 image in the top left corner...
  4. Hi, I suggest to you to start from here: http://www.w3schools.com/html/
  5. Hi, Count your rows and then use LIMIT. LIMIT offset, row count Your offset will be "Rownums"-2 so LIMIT "Rownums"-2
  6. Yeah, sure. Ask Google?: http://www.google.hu/search?sourceid=chrome&ie=UTF-8&q=php+session http://www.google.hu/search?sourceid=chrome&ie=UTF-8&q=php+session+tutorial
  7. bh

    MySQL Insert

    Hi, Is there an error message? -> http://www.phpfreaks.com/forums/index.php/topic,129174.0.html !
  8. Hi, I think you should starting with the forms structures. You use one form now for those datas. Rather you should use more forms (structured by logically isolated parts). You would to show over the users through the forms... Example: Personal details Human resources details ...
  9. bh

    sql sub query

    How many seconds now?
  10. bh

    sql sub query

    Hi, First: Use JOIN Second: Use Indexes. (create index those columns whereat you runs search - in your code: Type and length)
  11. Hi, Dont you heard about database normalization yeah? [off] -> yeah, some data [/off]
  12. Hi, Its a great question and exciting at all. Heres a simple example what im just done: class class_a extends class_b { public function func_a() { echo 'm'; return $this; } } class class_b { public function func_b() { echo 'n'; } } $a = new class_a(); $a->func_a()->func_b();
  13. Sadly theres no such a thing as ROWNUM or ROWID in MySQL. Im only guessing, but ive had an idea, and this is the result. SET @num = 0; SELECT (@num:=@num+1) AS abc, id, name FROM user__group GROUP BY abc HAVING abc > 2 AND abc < 4 @num is the alternate of ROWNUM. You cannot use @num in the WHERE clause, so you need the GROUP BY clause for the HAVING...
  14. This is wrong: -> Its from MySQL manual:
  15. Hi, Try this: ORDER BY 'post_date' DESC"
  16. Put it in your first script which always runs.
  17. If it is not necessary (IMO) you dont have to use Regexp at all costs. If your links always likes <a href="...">...</a> than use substr.
  18. Hi, in PHP: http://php.net/manual/en/function.date-default-timezone-set.php in php.ini: date/Default timezone
  19. Whats the error message? Anyway you should set strings into quotes: $query='UPDATE users SET name=\''.$_POST['username'].'\', ...
  20. Anyway its away from the topic. You can get wether the copy was success or failure: From php manuls: http://php.net/manual/en/function.copy.php And you can check the copy was whether successed example with http://php.net/manual/en/function.file-exists.php
  21. Again from php manuals: So, please... http://php.net/manual/en/function.move-uploaded-file.php
  22. "SELECT DISTINCT keywords FROM Core WHERE keywords LIKE '$letter%' AND Amount>=1 AND ({$adult}) ORDER BY keywords DESC"
  23. From the php manual for the move_uploaded_file function: 'valid uploaded file' = php runs the is_uploadedfile function within move_uploaded_file function. So mainly the move_uploaded_file is better when you want to move an uploaded file, cause security issues.
  24. Hi, if($adulton == 1) { $adult="adult=1 AND adult=0"; } Here, adult can be 1 and 0 at the same time. User OR connection. if($adulton == 1) { $adult="adult=1 OR adult=0"; }
  25. Theres a lot of choiches. Two of them: http://php.net/manual/en/function.file-get-contents.php http://php.net/manual/en/function.file-get-contents.php and google!!!: http://www.google.hu/search?sourceid=chrome&ie=UTF-8&q=php+file+read
×
×
  • 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.