-
Posts
1,807 -
Joined
-
Last visited
Everything posted by hitman6003
-
How to use GROUP BY or other solution to MySQL list
hitman6003 replied to 1219's topic in PHP Coding Help
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. -
Delete oldest information, to keep database small
hitman6003 replied to IsmAvatar's topic in MySQL Help
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) -
[SOLVED] Get last modified time of remote file during upload
hitman6003 replied to koramado's topic in PHP Coding Help
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. -
As the php manual states: http://www.php.net/srand
-
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
-
try casting the varbinary variable to varbinary in the sql query... SELECT * FROM tablename WHERE varbinary_column = CAST('$varbinary_php_var' AS varbinary)
-
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
-
AddType error with php installation
hitman6003 replied to Darkmatter5's topic in PHP Installation and Configuration
Is mod_mime enabled? -
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
-
Worth a try: SELECT DATABASE() AS project_id, name FROM db1.assertion, db2.assertion
-
see http://www.mysql.com/identifiers
-
Fulltext indexing. http://www.mysql.com/fulltext
-
what error does it give when it fails?
-
if ($search_string == "" || str_replace(' ', '', $search_string) == "") { echo 'You must enter a search term'; }
-
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.
-
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.
-
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...
-
[SOLVED] Get last modified time of remote file during upload
hitman6003 replied to koramado's topic in PHP Coding Help
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). -
[SOLVED] fclose not releasing write lock on Fedora?
hitman6003 replied to IsmAvatar's topic in PHP Coding Help
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. -
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.
-
echo not displaying and updating database not working
hitman6003 replied to doublea2k7's topic in PHP Coding Help
Then you probably have a syntax error somewhere in your script. Make sure display_startup_errors is turned on. -
http://en.wikipedia.org/wiki/Secure_Shell
-
how to invite ALL of contacts from Google, Yahoo & MSN
hitman6003 replied to plodos's topic in PHP Coding Help
http://www.google.com/search?hl=en&q=gmail+buddies+list+api http://www.google.com/search?hl=en&q=yahoo+messenger+api -
echo not displaying and updating database not working
hitman6003 replied to doublea2k7's topic in PHP Coding Help
http://www.phpfreaks.com/forums/index.php/topic,194542.msg876099.html#msg876099