Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by hitman6003

  1. There should be a closing " } while ..." statement for the do loop which will show exactly what it's looping through. It looks to be going through what are probably query results. The function simply escapes data and ensures it is of the correct type before using it in a SQL query. It is a sanitization routine.
  2. Sessions use a cookie (by default) to store a session id, which the server then uses to reference data stored for the identified session (stored in the server's temp directory by default). The cookie is lost when the browser is closed, which means that it will no longer be passed back to the server on subsequent visits, and the data is no longer associated with the user. The data is lost after a configurable period of time, I seem to recall that 60 minutes is the default. When you say you "ran it independently of the first one", were you using the CLI or a browser? Sessions do not apply to CLI scripts.
  3. place the column name in backtics (the key next to 1, with the tilde ~). INSERT INTO key_page (`keyword`, `page`) VALUES('keyword1', 'page1.php' )
  4. Display errors when you issue the update query... $query="UPDATE members SET address='$ud_address', city='$ud_city', state='$ud_state', zip='$ud_zip', phone='$ud_phone', email='$ud_email' WHERE id='$ud_id'"; mysql_query($query) or die(mysql_error());
  5. I don't think you can migrate between Windows and Linux...I believe they treat endian numbers differently which breaks binary compatibility. If it will work, you must use the same version of MySQL if possible...at a minimum, at least stay in the same minor revision series. In other words, you can't go from 4.x to 5.x, or even 5.0 to 5.1 in most cases, but you can go 5.0.45 to 5.0.67, and so on.
  6. hitman6003


    you need php's mysqli module. http://www.php.net/mysqli As for the others (libwbxml2 and tnef) you'll have to check the documentation for whatever app you're using.
  7. That just causes the browser to not cache the page locally, it has nothing to do with it not being in the history.
  8. Why not just do the math client side with javascript?
  9. Is google broken? http://allbrand.nu/thumbs/ http://ffmpeg-php.sourceforge.net/
  10. An entire seven seconds of Google yielded this: http://sourceforge.net/projects/phptoclib/
  11. See if your database contains any "\n" or "\r" characters. These are ignored by the browser, but depending on how you're viewing the database will show up correctly (replaced by an html line break) or as a space. echo str_replace(array("\n", "\r"), " ", $database_row['fieldname']);
  12. Clearing browser history is a client side function. PHP is a server based language. Your best hope is javascript, but I wouldn't count on that functionality, as it probably violates JS's sandbox.
  13. Cast the values into integers (or floats, if that's what they are): if( (int) $db < (int) $wb)
  14. You probably aren't getting an error, but rather a notice. These are harmless, however they usually point out small "good practices" in your code that need to be fixed. The one you are encountering is when you use a variable that hasn't been defined before. You can turn off notices by doing this: error_reporting(E_ALL ^ E_NOTICE); or you can define a default value for query...at the top of your page, put something like: <?php $query = "Unknown"; // ... rest of code or you can have a check where you print the value of $query... <?php print (empty($query) ? "unknown" : $query); ?>
  15. Just read the contents of the file into a string... $html = file_get_contents($filename);
  16. You can, however it is mysql specific... INSERT INTO tablename (column1, column2) VALUES ('value1', 'value2), ('value3', 'value4'), ('value5', 'value6');
  17. So long as it is an "auto-increment" column, the database will automatically insert a one-up value.
  18. use a foreach loop... foreach ($recipents as $recipient) { $mail->AddAddress($recipient); }
  19. Use a switch statement... http://www.php.net/switch
  20. It's MySQL instance specific, you set it in the my.(cnf|ini). Most of the time it's already enabled, but there is no memory devoted to it...give it some memory like so... -- the value is set in bytes, so the below is 16 MB SET GLOBAL query_cache_size = (1024 * 1024 * 16); http://dev.mysql.com/doc/refman/5.0/en/query-cache-configuration.html I think you might have to have the SUPER privilege to modify the global query cache...not sure.
  21. After looking at their documentation for exactly 3 seconds, I found the answer...please look their first... http://phpmailer.codeworxtech.com/methods.html
  22. It tells you what the problem is: In order to be a primary key the column has to be both unique and non-null. You don't have to set a default value (and you shouldn't in this case), but you have to insert something into that column EVERY time you issue an INSERT statement against it. Why are you using a text field as a primary key anyway? There are times when it is appropriate, however this isn't one of them. Because you are using it as a foreign key in another table, that means it must be duplicated many times over. This leads to storage bloat and very large indexes. Look at it this way..."username" is probably a VARCHAR, and probably ~ 30 characters in size. This means that for every record in that table, the index uses 30 bytes to store it...in addition to the actual storage on disk for the tuple's data. Now, when you use that column as a foreign key in another table, you (should) have an index on the foreign key column...another 30 bytes. If it's an InnoDB table, each additional index stores a reference to the primary key (30 bytes x # number of indexes)... Even if you only have the two indexes...primary key and foreign key...imagine how much RAM the indexes will consume if you have a million users (60 MB)...just for one table!
  23. I think that they vary based on how much data is being iterated over. Your best bet is to set up some tests and see which one is faster.
  24. Make sure the user is authorized to connect from "localhost" or "%" (all hosts). I don't remember how phpMyAdmin does it, but with some tools, if you don't specify a host (or explicitly tell it all hosts) it will create the account, but not allow access from any host.
  • 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.