Jump to content

Mchl

Staff Alumni
  • Posts

    8,466
  • Joined

  • Last visited

Everything posted by Mchl

  1. Is there an AUTO_INCREMENT primary key field in this table?
  2. 61x46cm, that'll be hell of a tatoo!
  3. DirectoryIterator to iterate over files Open first file, save first line to file 1, second to file 2, third to 3 etc... Open second file, save first line to file 1, second to file 2, third to 3 etc... Repeat until there are no more files.
  4. It will not raise a notice if the variable tested is not set at all.
  5. rifts: look it preg_match Wayniac: empty might be a better choice.
  6. And why do you need a database of all domains for that? Read this: http://en.wikipedia.org/wiki/Domain_Name_System and see if you can figure out what you really need.
  7. http://php.net/manual/en/reserved.variables.server.php
  8. No it isn't. When the user logs in, store the IP he connects from. THen on each request, if he logs in from different IP do wahtever you seem fit (deny / logout / redirect to disney.com)
  9. Not to mention that !($start <= 0) is same as $start > 0 and !($start >= $record_num - $per_page) is same as $start < $record_num - $per_page Keep it simple.
  10. The general cause of the error is that the variable on which the code called add_current_page() method is not an object (and it is expected to be) IF the number of lines don't match, double check that you're looking at the right file
  11. No you can't. Assumption that all variables passed to the constructor are to be assigned to object's fields is very often wrong.
  12. http://php.net/manual/en/function.spl-autoload.php http://www.php.net/manual/en/language.oop5.autoload.php I don't see how putting anything in _private dorectory would make it more secure, unless this directory is in fact outside sever's document root.
  13. You know you can just change your MySQL server's timezone to match the one used in PHP (or vice versa)? http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html http://www.php.net/manual/en/function.date-default-timezone-set.php
  14. Most likely you have a case sensitive collation set up for user_name column. Change to case insensitive and you should be fine.
  15. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=305981.0
  16. Because the person who was setting them up didn't care about matching their timezones.
  17. There are 13 fields and 14 values in this query. (And it's also vulnerable to SQL injection) $query = 'INSERT INTO contactss ( contactss_first, contactss_last, contactss_company, contactss_adress, contactss_city, contactss_provice, contactss_country, contactss_postal, contactss_phone, contactss_fax, contactss_email, contactss_cme, contactss_info ) VALUES ( "'.$_POST['first'].'", "'.$_POST['last'].'", "'.$_POST['company'].'", "'.$_POST['adress'].'", "'.$_POST['city'].'", "'.$_POST['province'].'", "'.$_POST['country'].'", "'.$_POST['postal'].'", "'.$_POST['phone'].'", "'.$_POST['fax'].'", "'.$_POST['email'].'", "'.$_POST['cme'].'", "'.$_POST['info'].'", NOW() )';
  18. You already got helped. BTW: mysqli also supports prepared statements.
  19. Yes it might affect the speed, and also how much data can be stored in other columns.
  20. Once all references to resultset resource are removed (by assigning a different resultset to the variable for example), PHP will try to free memory assigned to this resultset. MySQL does it's own garbage collection once the entire resultset has been sent to the application. Having said all this, manually closing results will not hurt you.
  21. In 5.1.x VARCHAR can hold up to 65,535 bytes. No need to move to TEXT. http://dev.mysql.com/doc/refman/5.1/en/char.html
  22. .docx files (Office 2007 and newer) are in fact XML files, so maybe that's what Wolphie has had in mind. This doesn't resolve problem with previous versions of .doc format.
  23. Not really. MySQL is coded to recognise SELECT COUNT(*) FROM tableName query and return stored rowcount. I'm not sure if this optimisation holds if you substitute * with actual field. Even if it does, there'd be no difference. Also notice that this optimisation will only be in effect, when there's no WHERE clause in the query (i.e. you want to count all rows in the table)
×
×
  • 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.