newbie SELECT question
Hi, I have a table containing page referral URLs gleaned from users browsing my website. Is there a way for me to use SELECT based on a portion record's contents? eg table contents: http://www.yahoo.com/adirectory/apage.htm http://google.net/adirectory/anotherpage.php I wish to return only the portion between the // and /. Sort of a //*/ thing so I can use COUNT with this to allow me to build a table in PHP of the most popular root domains which go to my site. I hope this all makes sense ;-) kind regards, Graham Nichols.
Syntax query
Hi, I have a directory of professional magicians, consisting of a MySQL table like this: +-++-+ | artist | area| magic | +-++-+ | Joe Bloggs | AZ*IN*TX | childrens | +-++-+ | Fred Smith | All | close-up | +-++-+ A surfer will select an area and then the type of magic they require via a php/HTML form. So to locate a performer who does magic for children in Texas I use SELECT * FROM artist WHERE (area LIKE '%$area%' OR area = 'All') AND magic LIKE '%$magic%' (where $area and $magic are variables passed from PHP). However, this does not give the desired result, it just returns any perfomer who does magic for children. What am I doing wrong please? I've tried several other syntax combinations without success. kind regards, Graham Nichols. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
SQL syntax question
Hi, I have a directory of professional magicians, consisting of a MySQL table like this: +-++-+ | artist | area| magic | +-++-+ | Joe Bloggs | AZ*IN*TX | childrens | +-++-+ | Fred Smith | All | close-up | +-++-+ A surfer will select an area and then the type of magic they require via a php/HTML form. So to locate a performer who does magic for children in Texas I use SELECT * FROM artist WHERE (area LIKE '%$area%' OR area = 'All') AND magic LIKE '%$magic%' (where $area and $magic are variables passed from PHP). However, this does not give the desired result, it just returns any perfomer who does magic for children. What am I doing wrong please? I've tried several other syntax combinations without success. kind regards, Graham Nichols. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Newbie table question
Hi, I have a newbie question, to which my mysql books didn't have an answer! It is: I have two tables with identical structures. I wish to copy the data from table B into (append) table A. What sql statement will achieve this please? kind regards, Graham Nichols. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
How to modify safe_mysqld to email when mysql server missing?
NatureHi, How can I modify safe_mysqld to make it email me if the mysql server fails/shuts down for some reason please? regards, Graham Nichols. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
mysql timing out? HELP!!!!
Hi, I have a customer who has a html page containing two frames on server A. The content files for these frames are on server B. He wants to keep his URL which is directed to server A, but server B has mysql and php support so we have to do this to accomodate him. It is working (kind of) but the second frame (php/mysql) is not loading and I think it is because the java navigation script in the first frame is slow so the second frame has to wait to load and it times out. Does this sound reasonable? If so, how can I increase the timeout time for the mysql/php server to get round this please? ANY help would be very much appreciated as I'm against the clock. I've been told that if I don't get it working by tomorrow morning (it's 23:15 here now) I am out of a job. Any advice appreciated. Guess I'll be here all night on this kamikaze mission. best, Graham - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: DISTINCT problem
Already done my friend - works like a dream. best, Graham -Original Message- From: Jeremy Zawodny [EMAIL PROTECTED] To: Graham Nichols [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: 29 July 2001 10:39 Subject: Re: DISTINCT problem On Thu, Jul 26, 2001 at 09:31:29PM +0100, Graham Nichols wrote: Distinct can only be used with count count(distinct field_name) --- OK for 3.23 NOT for 3.22 from MYSQL version 3.23. I have only version 3.22. How can I get around this please? Upgrade? :-) -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 -- NEW MySQL 3.23.29: up 43 days, processed 332,622,874 queries (89/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Correct DISTINCT syntax
What I'm trying to achieve is is a srfer visits the site each page visited will be inserted into the database. So, if the surfer visits 5 pages there will be 5 records inserted. Initially, I need to know that this is just ONE hit (one IP), with the next surfer to vist being the second IP. That day would then show 2 hits not five hits for the first surfer plus the pages visited by the second. regards, Graham Previous post shown below - Hi, I'm using MYSQL version 3.22.32. I have read that from version 3.23.xx COUNT can be used in combination with DISTINCT. However, I have a project deadline which does not give me time to upgrade. I have a small table 'web-stats' consisting of the following fields: IP_address web_date web_time web_referer browser page I am using a PHP script to insert entries into this table as a rudimentary hit counter. My current syntax is select web_date, dayofmonth(web_date) as d, count (IP_address) as c from web_stats group by d order by web_date but what I actually want is to count the unique IP addresses for each date. How can I work around this please? kind regards, Graham Nichols. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
DISTINCT problem
Hi, Distinct can only be used with count count(distinct field_name) --- OK for 3.23 NOT for 3.22 from MYSQL version 3.23. I have only version 3.22. How can I get around this please? kind regards, Graham Nichols - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Correct DISTINCT syntax for MYSQL version 3.22.32
Hi, I'm using MYSQL version 3.22.32. I have read that from version 3.23.xx COUNT can be used in combination with DISTINCT. However, I have a project deadline which does not give me time to upgrade. I have a small table 'web-stats' consisting of the following fields: IP_address web_date web_time web_referer browser page I am using a PHP script to insert entries into this table as a rudimentary hit counter. My current syntax is select web_date, dayofmonth(web_date) as d, count (IP_address) as c from web_stats group by d order by web_date but what I actually want is to count the unique IP addresses for each date. How can I work around this please? kind regards, Graham Nichols. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Copy table structure to another database?
Hi, Can I copy a table (structure only) to another database? I've searched though my manuals without success so far. kind regards, Graham - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Newbie group/count query question
I have a table which contains a date column and an order_number column. I need to formulate a query syntax to return the total number of orders for each day in a given month (if any). Can someone help me with the syntax please as I've been stumbling around with it all day without success. Many thanks, Graham - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
web application integration
Hi, Can anyone please point me toward any tutorials /. books regarding integrating web mysql data with ,say, a LAN-based accounting system? I'm not sure how to interface with dynamic files continually upgraded by surfers. Any comments welcome. regards, Graham - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Newbie frequency question
Hi, I have a list of words entered into a search engine held in a database. I wish to be able to select the top 10 words held in the database. I've fiddled around with ORDER DESC, DISTINCT and LIMIT etc but I can't hit upon the SQL syntax to obtain the correct result. Can someone please shine a light on my dim brain? The words are held in the dtaabase column 'word'. I'm having a really 'dumb' day today :-( Thanks, Graham - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Newbie frequency question
Hi, I have a list of words entered into a search engine held in a database. I wish to be able to select the top 10 words held in the database. I've fiddled around with ORDER DESC, DISTINCT and LIMIT etc but I can't hit upon the SQL syntax to obtain the correct result. Can someone please shine a light on my dim brain? The words are held in the dtaabase column 'word'. I'm having a really 'dumb' day today :-( Thanks, Graham - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Correct syntax?
Thanks for help from this group I'm using "select word, count(word) as total from search_words group by word order by total desc limit 20" to locate the top 20 words in a database of website search engine words. The database had been altered to include an extra column, other than the 'word' column. This means that 'word' can now have a null entry sometimes. How can I modify the sql query above to exclude any row(s) in 'word' with 'NULL' please? regards, Graham l - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Moving MySQL database(s)
Hi, I've developed my mysql databases/tables on a local intranet server. What's involved in correctly copying them to an online linux machine please? regards, Graham Nichols
Mysql dies
Hi, When trying to run mysql I get the message 'found old style password for user 'graham' . Restart using --old-protocol' How can I cure this problem please? I tried running mysql --old-protocol without success. Many thanks, Graham
Newbie question
Hi, I've installed mysql 3.22.32 and created a test table via mysql. now, when I try to run safe_mysqld --log I get the error message [[EMAIL PROTECTED]]$ Starting mysqld daemon with databases from /usr/local/var ./scripts/safe_mysqld: /usr/local/var/www.server-1.com.err: Permission denied rm: cannot remove `/usr/local/var/www.server-1.com.pid': Permission denied ./scripts/safe_mysqld: /usr/local/var/www.server-1.com.err: Permission denied ./scripts/safe_mysqld: /usr/local/var/www.server-1.com.err: Permission denied mysqld daemon ended How do I cure this please? Once I know this, I'm off the runway at long last!!! regards, Graham
mysqld daemon ended
Hi, I have installed mysql 3.22.32 on our local intranet for testing and it runs ok. Then, I transferred the same .tar file to a linux server of the 'net and installed as before. When I run ./scripts/safe_mysqld from the mysql-3.22.32 directory I get a message telling me that the daemon has started and then it appears to die with a 'mysqld daemon ended' message. Does anyone know what may be wrong please? Many thanks, Graham