Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

Everything posted by Mchl

  1. There is no $u_name property in this object. Maybe you want something like this: class register{ //Setting up Variables, you can add more, for example EMAIL. private $_username; private $_password; //Giving the variables values function __construct($u_name, $p_word) { $this->_username = $u_name; $this->_password = $p_word; } public function getUsername() { return $this->_username; } } //then echo $reg->getUsername();
  2. key_buffer_size = 64M Start by increasing that to 512MB-1024M, see what's the effect on your performance (might improve database, but impact negatively on other services) table_cache = 100M ???? do you have 100 million tables in your databse? http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_table_cache key_buffer = 16M what's that? documentation doesn't mention such variable sort_buffer_size See here for some tips: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_sort_buffer_size read_buffer_size Again, this is something you must consider yourself http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_net_buffer_length myisam_sort_buffer_size This is only used when creating/altering or repairing tables (table indexes specifically). Shoudln't affect normal operation Also consider enabling query cache http://dev.mysql.com/doc/refman/5.1/en/query-cache-configuration.html
  3. We've had issues with OpenID before. When logged in through OpenID I was not logged in on main site (and could not log in there).
  4. Ad 2) How difficult would it be to set up non-public clone of the site? It could use same database, but have separate application files.
  5. Use date function to get current hour. Then you can use different banner when hout is between 6PM and 6AM (night) and different when it's between 6AM and 6PM <?php $h = date('H'); if($h >= 6 && $h < 18) { echo 'display daytime banner'; } else { echo 'display nighttime banner'; }
  6. This is pretty much what BBCode tutorial would cover with the small addition that contents of tags should be passed to highlight_string() function
  7. Sorry,but until you actually have measured that over several hundreds page loads, I'll remain unconvinced.
  8. First of all, how do you know some videos are chosen more often than others? Do you have something that counts that and analyzes the frequncies?
  9. Not really. More like this: class myMySQLiAccess extends mysqli { public function __construct($host = null, $username = null, $passwd = null, $dbname = null, $port = null, $socket = null) { parent::__construct($host, $username, $passwd, $dbname, $port, $socket); } } if you want to hardcode your access credentials (not really a good idea) it would look like this class myMySQLiAccess extends mysqli { public function __construct($host = null, $username = null, $passwd = null, $dbname = null, $port = null, $socket = null) { parent::__construct('localhost', 'root', 'password', 'mydatabase'); } } $con = new myMySQLiAccess(); closing is done like this $con->close(); but in most cases you can safely let PHP close the connection for you (it does it automatically when script ends, or when the scope of $con is destroyed)
  10. When you use OO interface of mysqli you do $connection = new mysqli(..); so with more connections you do $connection1 = new mysqli(...); $connection2 = new mysqli(...); where $connection1 and $connection2 are MySQLi objects, that 'know' which connection to use.
  11. Unless your DBA tells you otherwise, don't use it.
  12. Regarding "File does not begin with '%PDF-'. issue: try opening the pdf in notepad and seeing what it starts with. It's likely a PHP's error message.
  13. Mchl


    No problem. Take special attention to mysql_real_escape_string function. It's there to protect you against SQL injections. Learn how to use it, and use it.
  14. Mchl


    Did I tell you to use $_POST['mypassword']? I guess not. The field in your form has name="password" so you need to use $_POST['password'] <?php //connct to database... $password = md5($_POST['password']); $username = mysql_real_escape_string($_POST['username']); $email= mysql_real_escape_string($_POST['email']); mysql_query("INSERT INTO members (username, password, email) VALUES ('$username', '$password', '$email')");
  15. Mchl


    [edit] Gah... too sleepy $wagwoord = md5("password"); //this is what I added should be $wagwoord = md5($_POST['password']); //this is what I added also make sure a field in database is able to store at least 32 characters (that's how long MD5 hashes are)
  16. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=315396.0
  17. Which version of Windows is that? Do you have administrative privileges? Did you delete all XAMPP folders before installing WampServer? Is WampServer's icon in system tray white or yellow/red? If it's yellow - are you using Skype?
  18. There are two things wrong with this query. 1. Something is wrong before FROM messages ... - maybe a column missing, or an extra comma (,). 2. Should be WHERE id IS NULL
  19. One thing PHP lacks is a formal specification of the language. There only is a Zend's implementation, which must be taken as a point of reference by anyone who would like to create their own interpreter. Since this implementation in turns hasn't got a roadmap, or a set of goals to achieve, it's always a moving target.
  20. Also PHP-MSSQL, PHP-Postgres, PHP-Oracle, PHP-SQLite... No... I can't really see it coming. Just try to decide, if the issue is more on scripting side, or on database side. As a rule of thumb, if your question concerns PHP code, you should ask it in PHP section (even if there's also MySQL involved)
  21. You might have been thinking about transactions (available for InnoDB engine), where you can execute a query, but need to COMMIT it if you want the changes to actually take place, or can ROLLBACK it when something's not right. http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html
  • 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.