Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Do you have a firewall? If so, you need to unblock port 80.
  2. Have a check for the value in the row for each item in the select: <option value="sto" <?php echo $req_user_info['type_market'] == "sto" ? 'selected="selected" : ''; ?>>Stocks </option> [quote]What mysql query can i use to update a whole column in the database to = 0[/quote] Don't use a WHERE clause... [code]UPDATE table_name SET column = 0; [/code]
  3. You probably have a syntax error in your php. Turn on startup errors: ini_set('display_startup_errors', 1);
  4. What is $mydb? Is it a string, e.g. the name of the database? Or is it the result of a mysql_connect operation (which would make it a resource object)?
  5. ''John Smiths'' ''2.48'' ''3.8'' Those are wrapped in two single quotes. They should have a single single quote and the single quotes inside the field should be escaped with a backslash ("\")
  6. Create an index on specials.product_id. That should eliminate the full table scan on that table, which should reduce the number of rows examined significantly.
  7. Because the primary key is used to find every row in the table. The primary key will always have an index on it that is the size of the entire field (e.g., if it is a CHAR(255) field, the index will be all 255 characters). So, if you have an INT (4 bytes) field and a DATETIME field (8 bytes) set as a hybrid primary key, then each row will add 12 bytes to the size of the index. Doesn't sound like much, but what if your application has a million rows? Suddenly you have a huge index that needs to be stored in memory, or read off disk. This is especially bad with InnoDB tables with multiple indexes. Each tuple in the non-primary key indexes stores a copy of the primary key for the record that it is indexed for. So, using the same example from above, if you have two indexes, suddenly each insert requires a minimum of 24 bytes, not including the size of the column(s) indexed by the second index or the size of the record itself.
  8. All of your file writing is done in the function "WriteToFile", which you haven't provided code for. We can not help you without the relevant code.
  9. <?php $num_to_remove = 3; $file = file($filename); // php5 only file_put_contents($filename, implode("\n", array_slice($file, $num_to_remove))); // php4 /* $open = fopen($filename, 'w'); fwrite($open, implode("\n", array_slice($file, $num_to_remove))); fclose($open); */
  10. Define "solid user management system". If you only want to manage username/password combos, then there is a million examples and tutorials on the internet. Google is your friend. If you want something more robust, e.g., profiles w/pictures, etc., then look at systems that provide similar functionality to what you are trying to create...if you are creating a forum, look to the code of SMF. If you are creating a wiki, look to the code of Mediawiki.
  11. You could make them both a part of the primary key (not recommended), or you could implement a check in your code...i.e., query the database before doing the insert to verify that the score has not already been inserted.
  12. Even the best CAPTCHA (arguable Google's) can be broken by OCR (optical character recognition), where a computer is able to recognize the characters in the image. The spammers are not directly inserting into your database, rather they are most likely using the comments system to post them (I'm assuming you have a blog or something similar). Probably not. Generally speaking SQL injection is malicious...the attacker wants to cause damage, not post spam. Yes. And use mysql_real_escape_string on all user input (e.g. anything in the $_POST array) that is used in a query). You may want to use a service like Akismet to attempt to prevent spam from being posted to your website. It is free (to my knowledge).
  13. Does that data come from / is written to a text file? If so, then it is possible for two requests to attempt to access the file at the same time, which would corrupt the text file. In database terms, this is almost exactly like a deadlock, except rather than denying access to both, it grants access to both and they corrupt the data.
  14. //sql query inserting data into database Are you reassigning the $result variable to what is returned by this query?
  15. http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  16. SELECT id, article_title FROM table_name ORDER BY date_submitted DESC LIMIT 1
  17. if you look at the html source (output to the browser), what does it look like...
  18. What are you trying to do? You haven't actually asked anything...besides to look at the site.
  19. What does the text in the value attribute look like? In other words, what is php putting out? Does it look normal? Is it malformed?
  20. http://framework.zend.com/manual/en/zend.mail.html or http://phpmailer.codeworxtech.com/
  21. each item in the IN clause should be separate: SELECT ... FROM ... WHERE groupname IN('test', 'thisisnew')
  22. http://www.phpclasses.org/browse/package/1805.html
  23. You are reassigning the value of $result in your loop. Use a different variable name for the result of mysql_query inside the while loop.
  24. regardless of what query you are issuing, anytime you use user input (i.e. the $_POST array) in a query, you should sanitize the variables using mysql_real_escape_string.
×
×
  • 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.