Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Please provide only relevant code. You are probably looking for a DISTINCT query... http://www.mysql.com/distinct But I am too lazy / don't care enough to dig through all the code to find where your query is.
  2. You may be able to use something like this: DELETE FROM discuss WHERE dtime < (SELECT dtime FROM discuss ORDER BY dtime DESC LIMIT 30, 1)
  3. cURL is basically a command line web client. It has some other functionality, but unless the client files are actually files on another web server, then it won't work.
  4. As the php manual states: http://www.php.net/srand
  5. Those are data (*.MYD) and index (*.MYI) files for a mysql table. if you delete them, it will delete the mysql table (and probably screw with the database as well). If you need to shrink them, remove some data from the table. If the table is no longer inserted into (i.e. it's read only) you can use myisampack to compress it. You can try and OPTIMIZE the table, but you probably won't get much improvement. http://dev.mysql.com/doc/refman/5.0/en/optimize-table.html
  6. try casting the varbinary variable to varbinary in the sql query... SELECT * FROM tablename WHERE varbinary_column = CAST('$varbinary_php_var' AS varbinary)
  7. Straight from the MySQL manual: SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM test_table; Creates a csv file that is readable by Excel. http://www.mysql.com/select#id1949480
  8. you could enclose the "order" in backticks ( ` ... not a single quote ), but as fenway suggested, choosing column names that are not reserved words is by far the best choice. http://www.mysql.com/identifiers
  9. Worth a try: SELECT DATABASE() AS project_id, name FROM db1.assertion, db2.assertion
  10. see http://www.mysql.com/identifiers
  11. Fulltext indexing. http://www.mysql.com/fulltext
  12. what error does it give when it fails?
  13. if ($search_string == "" || str_replace(' ', '', $search_string) == "") { echo 'You must enter a search term'; }
  14. He never stated it was a "simple search". If all content on the site is considered "news", then search becomes vital. Inaccurate search is worse than no search in most cases, so fulltext indexing may be the best solution.
  15. What storage engine are you using? MyISAM (and Falcon and Maria) all have builtin full text indexing, which is a VAST improvement over the 'WHERE column LIKE "%word%"' SQL queries. Aside from using one of the above storage engines (Falcon and Maria are MySQL 6 only at the moment, so it's MyISAM or bust) you can use an external full text indexer...Lucene, sphinx, etc.
  16. add a "<br />" at the end of each file link... $thelist .= '<a href="'.$file.'">'.$file.'</a><br />';
  17. Why not return the element you want? function doSomething( $element = null ){ $arr[] = 'something'; $arr[] = 'something_else'; // return the entire array if no element is specified // else return the specified element return (is_null($element) ? $arr : $arr[$element]); } echo doSomething( 0 ); You could also make an object out of it and address it that way...
  18. Your server, and consequentially PHP, doesn't have access to the remote file until it's uploaded. Your only hope is javascript (or some other client side script...vbscript, etc), and I'm pretty sure it's sandboxed so that what you are asking won't work (I could be wrong though).
  19. It's probably not a "write lock" on the file, but a permission issue. Whenever a file is on the desktop that you don't have permissions on, it shows up with a lock (su to root, set the umask to 077 and create a file on the logged in user's desktop...you'll see the same lock on the icon). Add yourself to the same group as the apache user and make sure the group has read/write permissions. Or chmod the file (as root) to 777, then see if the lock goes away.
  20. There is a bit of a workaround... -- essentially we are determining the number of spaces in the string (by subtracting the length -- of the string without spaces from the length with) and dividing the number of spaces into the -- total number of characters SELECT LENGTH(column_name) / (LENGTH(column_name) - LENGTH(REPLACE(column_name, ' ', ''))) AS num_of_words FROM table_name It's not 100% accurate, but it'll pass.
  21. Then you probably have a syntax error somewhere in your script. Make sure display_startup_errors is turned on.
  22. http://en.wikipedia.org/wiki/Secure_Shell
  23. http://www.google.com/search?hl=en&q=gmail+buddies+list+api http://www.google.com/search?hl=en&q=yahoo+messenger+api
  24. http://www.phpfreaks.com/forums/index.php/topic,194542.msg876099.html#msg876099
×
×
  • 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.