Re: Need help installing PHP (Linux) with MySQL and Apache
On Mon, 2002-10-21 at 13:07, Chip Rose wrote: I can't get PHP-4.2.3 compiled to work with MySQL and Apache, despite months of trying. Apache compiled ok, and so did MySQL -both work, on my Debian Linux box. I've tried various combos of installing the Deb packages, compiling from source, and various combinations thereto. I started out using http://hotwired.lycos.com/webmonkey/00/44/index4a_page4.html?tw=programming as a guide, in efforts to create a way of accessing MySQL via PHP Gui of some sort. I've been trying for months, on and off, using Redhat, Mandrake, and now Debian3.0. I've tried getting Escapade installed, but pages won't load unless I change a line in httpd.conf, and then Apache won't run because it complains of the changed line in httpd.conf, which was supposedly necessary to get Escapade to run. Typing ./httpd -l in my Apache bin directory shows that mod_so.c is an enabled module. My attempt to compile PHP-4.2.3 by typing ./configure --with-mysql=/usr/bin/ resulted in the following error message configure: error: Cannot find header files under /usr/bin/ I've tried changing the path to MySQL headers, but still get same error msg. I really don't know how to find these MySQL headers since I wouldn't know one if I saw it. Can someone help with a pointer/link? I'd very greatly appreciate it.. if Mysql was installed by rpm try pointing it to /var/lib/mysql. if compiled by yourself it's the directory you untarred and ran make/ make install. John - 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: need help mysql-server lost the tcp/ip-connection
Hello jantos, Tuesday, October 15, 2002, 2:03:50 PM, you wrote: jamdd when I'm connecting to mysql-server via tcp/ip then the mysql-server jamdd cuts the connection and it restarts the mysql-server. jamdd when I don't make connections from other hosts than it's running well jamdd until i make connections via tcp/ip from other hosts. jamdd on the client site: jamdd mysql -h Mymysql-server jamdd and I allways get: jamdd ERROR 2013: Lost connection to MySQL server during query jamdd on the server-host I get the message: jamdd bin/safe_mysqld: line 273: 11987 Segmentation fault $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION jamdd --pid-file=$pid_file --skip-locking $err_log 21 jamdd Number of processes running now: 1 jamdd mysqld process hanging, pid 11990 - killed jamdd 021015 12:37:53 mysqld restarted Release: mysql-3.23.53-max (Official MySQL-max binary) As this is the official MySQL binary statically linked, I would first try to upgrade the kernel, but just to be sure that the kernel is not the source of a problem. Then I'd go with the hardware as often such things happens because of broken memory, kernel panics and such. Try to see what dmesg outputs - maybe there are a clue on hardware failures?.. -- For technical support contracts, goto https://order.mysql.com/?ref=ma02-010c This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: Need help with simple problem... I think
On Thursday, September 26, 2002, at 10:46 AM, Darrell A. Sullivan, II wrote: I am sure I am going to feel ignorant when I get the answer to this question because it will be something simple that I have overlooked, but here goes anyhow. I am using MySQL Version 3.23.51-max. I am developing an N-tier application using Java on the server side accessing MySQL through JDBC. On one of my tables whenever someone makes a change to the record, what I actually need to do is create a new record that is an exact copy of the existing record and apply the changes to it and set a deactivation date on the original record so that it can later be viewed and we can see when it was active and when it was deactivated. My problem is that I can't seem to put the SQL together to do this. You can't do an Insert...Into where the destination table also appears in the From clause. What I need is something like insert into t1 select * from t1 where t1.ID=x. I have looked into the Select statement to see if there was a way to do a Select t1.* into t2 temp from t1 where t1.id=x to create a temporary table and then do an insert into t1 select * from t2, but so far I can't see any way of doing this. It could be done in code by doing a select and rounding up all the names of the fields except for the primary key and then creating an insert statement using the field names and values, but if there is a simpler and less convoluted way of going about it I would prefer it. Try this: Create Temporary Table temp_table Select * From t1 Where ID = 'x'; Update temp_table Set ActivationDate = Now() where ID = 'x'; Insert into ti select * from temp_table where ID = 'x'; When I tried this a got a table already exist error on the first line, but the table was created correctly. I also got an error on the third line but again it was entered correctly. -- Clayburn W. Juniel, III -- Effective Software Solutions Phone: (602) 326-7707Mobile: (602)326-7707 Email: [EMAIL PROTECTED] http://EffectiveSoftwareSolutions.com -- - 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: need help on DROP.
At 16:26 -0700 9/10/02, Daniel Curry wrote: I am unable to find the specific DROP command to remove only test@%, test\_%@%, snort@localhost, and snort@%. I think you want DELETE, not DROP. DELETE FROM db WHERE Db='test' AND Host='%'; DELETE FROM db WHERE Db='test\_' AND Host='%'; DELETE FROM db WHERE Db='snort' AND Host='localhost'; DELETE FROM db WHERE Db='snort' AND Host='%'; I am trying to clean up my db information. Thank you. mysql select * from db; +---+--++-+-+-+-+-+---++-+++ | Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | +---+--++-+-+-+-+-+---++-+++ | % | test || Y | Y | Y | Y | Y | Y | N | Y | Y | Y | | % | test\_% || Y | Y | Y | Y | Y | Y | N | Y | Y | Y | | localhost | snort| snort | Y | Y | Y | Y | Y | N | N | N | N | N | | % | snort| snort | Y | Y | Y | Y | Y | N | N | N | N | N | | localhost | snort_db | snort | Y | Y | Y | Y | N | N | N | N | N | N | | % | snort_db | snort | Y | Y | Y | Y | N | N | N | N | N | N | +---+--++-+-+-+-+-+---++-+++ 6 rows in set (0.00 sec) - 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
Re: need help on DROP.
Paul, Thank you. That did it. You are correct I needed to DELETE. Paul DuBois wrote: At 16:26 -0700 9/10/02, Daniel Curry wrote: I am unable to find the specific DROP command to remove only test@%, test\_%@%, snort@localhost, and snort@%. I think you want DELETE, not DROP. DELETE FROM db WHERE Db='test' AND Host='%'; DELETE FROM db WHERE Db='test\_' AND Host='%'; DELETE FROM db WHERE Db='snort' AND Host='localhost'; DELETE FROM db WHERE Db='snort' AND Host='%'; I am trying to clean up my db information. Thank you. mysql select * from db; +---+--++-+-+-+-+-+---++-+++ | Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | +---+--++-+-+-+-+-+---++-+++ | % | test || Y | Y | Y | Y | Y | Y | N | Y | Y | Y | | % | test\_% || Y | Y | Y | Y | Y | Y | N | Y | Y | Y | | localhost | snort| snort | Y | Y | Y | Y | Y | N | N | N | N | N | | % | snort| snort | Y | Y | Y | Y | Y | N | N | N | N | N | | localhost | snort_db | snort | Y | Y | Y | Y | N | N | N | N | N | N | | % | snort_db | snort | Y | Y | Y | Y | N | N | N | N | N | N | +---+--++-+-+-+-+-+---++-+++ 6 rows in set (0.00 sec) - 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
Re: need help on DROP.
Clarify your question ... are you trying to drop TABLES, DATABASES, or modify user privileges? If you are trying to modify user privileges, use GRANT or REVOKE. - Original Message - From: Daniel Curry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 6:26 PM Subject: need help on DROP. I am unable to find the specific DROP command to remove only test@%, test\_%@%, snort@localhost, and snort@%. I am trying to clean up my db information. Thank you. mysql select * from db; +---+--++-+-+--- --+-+-+---++-+-- --++ | Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | +---+--++-+-+--- --+-+-+---++-+-- --++ | % | test || Y | Y | Y | Y | Y | Y | N | Y | Y | Y | | % | test\_% || Y | Y | Y | Y | Y | Y | N | Y | Y | Y | | localhost | snort| snort | Y | Y | Y | Y | Y | N | N | N | N | N | | % | snort| snort | Y | Y | Y | Y | Y | N | N | N | N | N | | localhost | snort_db | snort | Y | Y | Y | Y | N | N | N | N | N | N | | % | snort_db | snort | Y | Y | Y | Y | N | N | N | N | N | N | +---+--++-+-+--- --+-+-+---++-+-- --++ 6 rows in set (0.00 sec) - 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
Re: need help on a SQL query: need LEFT JOIN?
You wrote: I apologize for asking such a basic SQL question, but I am failing in finding the solution... Consider the following table: id | option --- 1 | a 2 | a 2 | b I want to find the ids with only a specific set of options. For example, if I wanted to get the ids which have option a only, the query should give me 1 as a result, not 1 and 2. I suspect I need to use a LEFT JOIN on the same table, but I have failed miserably so far... Many thanks in advance to the SQL experts ;-). Jean-Luc (http://jfontain.free.fr/moodss/) There are no need to use the left join in this query. The best way to do what you wanna is within the following query: SELECT id FROM table GROUP BY id HAVING COUNT(option) = 1; You can change the count value to take the ids that have specified number of options. Luís Fernando - 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: need help on a SQL query: need LEFT JOIN?
I wrote: I apologize for asking such a basic SQL question, but I am failing in finding the solution... Consider the following table: id | option --- 1 | a 2 | a 2 | b I want to find the ids with only a specific set of options. For example, if I wanted to get the ids which have option a only, the query should give me 1 as a result, not 1 and 2. I suspect I need to use a LEFT JOIN on the same table, but I have failed miserably so far... Many thanks in advance to the SQL experts ;-). Thank you very much to all for your responses: it led me to the solution and in the process improved my SQL level: select id from t left join t as u on (t.id = u.id) and (t.option = u.option) and ( (t.option = 'a') or (t.option = 'b') or ... ) group by t.id having (count(*) = count(u.id)) and (count(*) = N) * with N = number of options to match Thanks again! Jean-Luc (http://jfontain.free.fr/moodss/) - 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: need help on a SQL query: need LEFT JOIN?
Does this work? select t.id,t.option,t2.option from tableName t left join tableName t2 on t.id=t2.id and t2.option!=t.option where t.option=a and isnull(t2.option); HTH, Jed On the threshold of genius, [EMAIL PROTECTED] wrote: I apologize for asking such a basic SQL question, but I am failing in finding the solution... Consider the following table: id | option --- 1 | a 2 | a 2 | b I want to find the ids with only a specific set of options. For example, if I wanted to get the ids which have option a only, the query should give me 1 as a result, not 1 and 2. I suspect I need to use a LEFT JOIN on the same table, but I have failed miserably so far... Many thanks in advance to the SQL experts ;-). Jean-Luc (http://jfontain.free.fr/moodss/) - 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
Re: Need help with Statically Compiled MySQLGUI 1.7.5-1
PathFinder, Wednesday, September 04, 2002, 10:25:46 PM, you wrote: PS I am a not yet that experienced with System Administration and PS need a little holding hand here if possible. PS I am running Red Hat 6.2 with MySQL installed and running. PS Frankly I have read the README and HELP and still not sure as to PS what I am suppose to do with the my.cnf. PS When I try to run it with the ./my.cnf from the directory where PS MySQLGUI 1.7.5-1 is installed here is the error message I get: PS [root@mail mysqlgui-1.7.5-1-linux-static]# ./my.cnf PS ./my.cnf: [client]: command not found PS ./my.cnf: port: command not found PS Using domain server: PS Name: localhost.track2you.com PS Address: 127.0.0.1 PS Aliases: PS Host not found. PS ./my.cnf: [client_fltk]: command not found PS ./my.cnf: database: command not found Where can my.cnf be located read here: http://www.mysql.com/doc/en/Option_files.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: Need help with Statically Compiled MySQLGUI 1.7.5-1
It is just a config file. You don't run it. PathFinder Software wrote: Hi, I am a not yet that experienced with System Administration and need a little holding hand here if possible. I am running Red Hat 6.2 with MySQL installed and running. Frankly I have read the README and HELP and still not sure as to what I am suppose to do with the my.cnf. When I try to run it with the ./my.cnf from the directory where MySQLGUI 1.7.5-1 is installed here is the error message I get: [root@mail mysqlgui-1.7.5-1-linux-static]# ./my.cnf ./my.cnf: [client]: command not found ./my.cnf: port: command not found Using domain server: Name: localhost.track2you.com Address: 127.0.0.1 Aliases: Host not found. ./my.cnf: [client_fltk]: command not found ./my.cnf: database: command not found Can you walk me though with what to do and perhaps how to configure the my.cnf? Your time is appreciatted. Regards, Normand J. Charette PathFinder Software/Affiliate Software [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.PathFinderSoftware.com http://www.AffiliateTrackingSoftware.com - 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
Re: Need help how to make Directory system in MySQL with 6.5 mill subscribers ?
On Tuesday 13 August 2002 06:50 pm, Steinar Kolnes wrote: Just create indexes on first and last, that should improve the speed of your query drastically. It will of course be a BIG index. You might experiment with only making the width of the index small, like maybe 8 or 10 characters might be enough to get 99% of the benefit with a lot less size. You might experiment with only indexing last names as well, the query optimizer should then use that index first and will thus only have to do linear search through the resulting candidate records. I think the design of your table is fine. Note that adding NOT NULL to a column's definition saves you a small amount of space per row, and you probably don't want nulls anyway. Hi there, I have to make a large 6.5 million names and numbers database in MySql(maybe not so large for some of you). Yet it is very simple, here is my sql file: create table subscriber ( idbigint unsigned not null auto_increment primary key, subscr_id bigint unsigned, telco_id int unsigned, first char (80), last char (40), address char (40), postcodeint unsigned ); NB I also merged first and middle names into one first; All the above should be searchable. I have a separate table that take cares of postcodes and post names. However the search is very slow. It takes more than 3 minutes for a query to search for first and last name; Example: select * from subscriber where first like 'steinar%' and last like 'kolnes%'; Is there any out there that have an suggestion how I can speed things up, even if I increases the size to more than 10 mill. I planned to have separate tables for first, last and street addresses, however is this a good idea ? Rgs Steinar Kolnes - 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
Re: Need help how to make Directory system in MySQL with 6.5 millsubscribers ?
Hi, The best way to speed up your query would be to create a compound index on (first,last): create index first_last on subscriber(first,last); In this case, mysql will use it for both fields instead of doing a linear search for the second one. In order to reduce index size without loosing too much speed, you can also index a subset of each field: create index first_last on subscriber(first(8),last(8)); Hope this helps -- Joseph Bueno Tod Harter wrote: On Tuesday 13 August 2002 06:50 pm, Steinar Kolnes wrote: Just create indexes on first and last, that should improve the speed of your query drastically. It will of course be a BIG index. You might experiment with only making the width of the index small, like maybe 8 or 10 characters might be enough to get 99% of the benefit with a lot less size. You might experiment with only indexing last names as well, the query optimizer should then use that index first and will thus only have to do linear search through the resulting candidate records. I think the design of your table is fine. Note that adding NOT NULL to a column's definition saves you a small amount of space per row, and you probably don't want nulls anyway. Hi there, I have to make a large 6.5 million names and numbers database in MySql(maybe not so large for some of you). Yet it is very simple, here is my sql file: create table subscriber ( idbigint unsigned not null auto_increment primary key, subscr_id bigint unsigned, telco_id int unsigned, first char (80), last char (40), address char (40), postcodeint unsigned ); NB I also merged first and middle names into one first; All the above should be searchable. I have a separate table that take cares of postcodes and post names. However the search is very slow. It takes more than 3 minutes for a query to search for first and last name; Example: select * from subscriber where first like 'steinar%' and last like 'kolnes%'; Is there any out there that have an suggestion how I can speed things up, even if I increases the size to more than 10 mill. I planned to have separate tables for first, last and street addresses, however is this a good idea ? Rgs Steinar Kolnes - 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: Need help how to make Directory system in MySQL with 6.5 mill subscribers ?
You need an index, it should drastically cut the query time. See: http://www.mysql.com/doc/en/CREATE_INDEX.html#IDX1466 Mike Hillyer Dynamergy Software -Original Message- From: Steinar Kolnes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 4:50 PM To: Mysql List Subject: Need help how to make Directory system in MySQL with 6.5 mill subscribers ? Hi there, I have to make a large 6.5 million names and numbers database in MySql(maybe not so large for some of you). Yet it is very simple, here is my sql file: create table subscriber ( id bigint unsigned not null auto_increment primary key, subscr_id bigint unsigned, telco_idint unsigned, first char (80), lastchar (40), address char (40), postcode int unsigned ); NB I also merged first and middle names into one first; All the above should be searchable. I have a separate table that take cares of postcodes and post names. However the search is very slow. It takes more than 3 minutes for a query to search for first and last name; Example: select * from subscriber where first like 'steinar%' and last like 'kolnes%'; Is there any out there that have an suggestion how I can speed things up, even if I increases the size to more than 10 mill. I planned to have separate tables for first, last and street addresses, however is this a good idea ? Rgs Steinar Kolnes - 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
Re: Need help how to make Directory system in MySQL with 6.5 mill subscribers ?
In the last episode (Aug 14), Steinar Kolnes said: I have to make a large 6.5 million names and numbers database in MySql(maybe not so large for some of you). Yet it is very simple, here is my sql file: create table subscriber ( id bigint unsigned not null auto_increment primary key, subscr_id bigint unsigned, telco_id int unsigned, first char (80), last char (40), addresschar (40), postcode int unsigned ); NB I also merged first and middle names into one first; You'll probably want to split them back out. That means you can't index the middle name all by itself (if you ever needed to), and it means that even if you only want to index the first name, you have to pull in all the middle-name data as well. Also change your CHARs to VARCHAR; you're probably wasting a lot of space in the table. What percentage of first names are over 15 characters, let alone 40? All the above should be searchable. I have a separate table that take cares of postcodes and post names. However the search is very slow. It takes more than 3 minutes for a query to search for first and last name; Example: select * from subscriber where first like 'steinar%' and last like 'kolnes%'; That's because you're doing a full table scan of a table that's at minimum 6.5MB * 180 = 1.1gb :) Although that only comes out to a data rate of 7MB/sec; mysql should have been able to scan much faster than that. If most of your searches are likeyour example, try creating an index on the first 5 characters of first and last. Also create a separate index on last. Searches on firstname or first+last will use the combined index; searches on lastname will use the lastname index. ALTER TABLE mytable ADD KEY ( first(5), last(5) ), ADD KEY ( last(5) ); Also run EXPLAIN on some test queries. Tf the 'rows' column is still too large or the 'key' column is NULL, try indexing the entire first+last field (i.e. drop the (5) from the ADD KEY clause). Is there any out there that have an suggestion how I can speed things up, even if I increases the size to more than 10 mill. I planned to have separate tables for first, last and street addresses, however is this a good idea ? You mean separate lookup tables? That would definitely save space since you will have a lot of duplicate entries. It will complicate searches, though, since you will have to join your primary, first, and last tables together for the search. It also makes modification of a single record a lot harder (since you may have to add records to the secondary tables if a name changes). I'd say leave it as one table. -- Dan Nelson [EMAIL PROTECTED] - 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: Need help with Tables/Attributes
Hello Nitesh, You can find that and more at... http://www.mysql.com/doc/A/L/ALTER_TABLE.html Good Luck, --- Nitesh Divecha [EMAIL PROTECTED] wrote: Hello All, I need help with tables. I have created my table with some attributes in it. I need to modify my table attributes, can any one help me with the modify command or can give me the short cut to the web. Example: Mysql create table test(ID int(4), Name varchar(20), Sex varchar(1)); Now I need to change the attribute NAME TO Full name, HOW? Please help, Thanking in Advance. Regards Nitesh - 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 __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com - 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: Need help with Tables/Attributes
Hi, I suppose that what you want would be something like: Mysql create table test(ID int(4), Name varchar(20), Sex varchar(1)); Mysql alter table test change Name FullName varchar(40); You should read this for more information about ALTER TABLE: http://www.mysql.com/doc/A/L/ALTER_TABLE.html On Thu, 2002-07-25 at 23:45, Nitesh Divecha wrote: Hello All, I need help with tables. I have created my table with some attributes in it. I need to modify my table attributes, can any one help me with the modify command or can give me the short cut to the web. Example: Mysql create table test(ID int(4), Name varchar(20), Sex varchar(1)); Now I need to change the attribute NAME TO Full name, HOW? Please help, Thanking in Advance. Regards Nitesh -- Diana Soares - 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: Need help with Tables/Attributes
Nitesh, Friday, July 26, 2002, 1:45:35 AM, you wrote: ND I need help with tables. I have created my table with some attributes in ND it. ND I need to modify my table attributes, can any one help me with the ND modify command or can give me the short cut to the web. ND Example: ND mysql create table test(ID int(4), Name varchar(20), Sex varchar(1)); ND Now I need to change the attribute NAME TO Full name, HOW? Use ALTER TABLE: http://www.mysql.com/doc/A/L/ALTER_TABLE.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: Need help with Tables/Attributes
Hello! Nitesh Divecha wrote: Hello All, I need help with tables. I have created my table with some attributes in it. I need to modify my table attributes, can any one help me with the modify command or can give me the short cut to the web. Example: Mysql create table test(ID int(4), Name varchar(20), Sex varchar(1)); Now I need to change the attribute NAME TO Full name, HOW? Please help, Thanking in Advance. As far as I understood the ALTER TABLE syntax, this cannot be done that easily, try: ALTER TABLE test ADD COLUMN Full_name int AFTER ID; UPDATE test SET Full_name = Name; ALTER TABLE test DROP COLUMN Name; Greetings Ralf sql query -- Ralf Narozny SPLENDID Internet GmbH Co KG Skandinaviendamm 212, 24109 Kiel, Germany fon: +49 431 660 97 0, fax: +49 431 660 97 20 mailto:[EMAIL PROTECTED], http://www.splendid.de - 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: Need Help with mysqlimport please-urgent!
Don't use 'root' ... create a new user, and make sure you GRANT the proper privs (i.e.: USE mysql; GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO username@% IDENTIFIED BY 'password' WITH GRANT OPTION; - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, July 17, 2002 5:42 AM Subject: Need Help with mysqlimport please-urgent! Hello, Here is my problem, I would like to use mysqlimport (which i have compiled as a batch file to run) from a client side to load data onto the database on a server side, meaning that I would normally access my server through the pc and running the batch file. Problem is that there are no errors but the tables on the server side does not get updated but instead points to updating my local database, data are loaded into my tables instead (i have the exact replica database on my own pc). Here is a sample command line from my batch file @h:\mysql\bin\MYSQLI~1.EXE --replace --host=host_name --user=root --fields-terminated-by=, --fields-enclosed-by=\ --lines-terminated-by =\r\n BO h:\mysql\data\BO\outnum i've mapped h:\ as pointing to the c:\ of my server..is that possible? [The error relates to 'access denied for @pc_id (i think its the same network id used for login to a NT domain) to BO database' or at times 'the mysql does not support this version'] P.S. My table name is outnum which is the same as the file name, MySQL version is 3.23.51. What am i doing wrong here? Need help please (could someone guide me what to do from the very beginning. I need to run mysqlimport as if i'm running any program from the console itself but only from a remote terminal). To simplify, what i need here is a way to run mysqlimport from my pc to pump data into the tables on the MySQL server instead of the data being thrown in my local MySQL server.Urgent! Thank you. Regards, Eric Loe. ** NOTICE OF CONFIDENTIALITY ** This message and any files transmitted with it may be privileged and/or confidential and are intended only for the use of the addressee. If you, the reader of this message, are not the intended recipient, you should not disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately by return email and delete the original message. Thank you. - 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
Re: Need help on Matching MySQL, Apache PHP
Pada Sat, 06 Jul 2002 15:10:43 + duo fu [EMAIL PROTECTED] menulis : Dear Friends: I have installed Apache 1.3.26, MySQL.3.23.51 successfully. However, I failed to install tarball versions of PHP4.21 with Apache1.3.26 under my REDHAT 6.2. I always got the error message when I tried to start the APache. - [root@broekhoven libexec]# /usr/local/apache/bin/apachectl start Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/local/apache/libexec/libphp4.so: undefined symbol: pcre_malloc /usr/local/apache/bin/apachectl start: httpd could not be started -- try to use your PHP as cgi rather than as module (change the config on httpd.conf) ... it should be easier if you don't want/avoid installing all from source (again) :D -- printk(??? No FDIV bug? Lucky you...\n); 2.2.16 /usr/src/linux/include/asm-i386/bugs.h MySQL 3.23.51 : up 16 days, Queries : 368.312 per second (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: Need help on Matching MySQL, Apache PHP
I would suggest you build apache and php from source. instructions can be found at http://www.php.net/manual/en/install.apache.php. dan * duo fu ([EMAIL PROTECTED]) wrote: Dear Friends: I have installed Apache 1.3.26, MySQL.3.23.51 successfully. However, I failed to install tarball versions of PHP4.21 with Apache1.3.26 under my REDHAT 6.2. I always got the error message when I tried to start the APache. - [root@broekhoven libexec]# /usr/local/apache/bin/apachectl start Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/local/apache/libexec/libphp4.so: undefined symbol: pcre_malloc /usr/local/apache/bin/apachectl start: httpd could not be started -- Should I use the RPM instead of tar ball? Must I use PHP3. instead of PHP4. under RedHat6.2? Could anyone help me with this problem? THank you very much! Duo - 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: Need help with a complex query
Try - and I mean *try* :-) SELECT Customers.* FROM Customers, Subscriptions LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID) LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id (Ordered_Items.productid = '23')) WHERE Customers.id=Subscriptions.customerid AND Subscriptions.listid='2' AND Ordered_Items.orderid IS NULL AND Orders.customerid IS NULL AND NOT Customers.bad_email; Well, MySQL has been chugging on this one for about 15 minutes now, and it's still going. So I'm not sure if it is a problem with the query or the optimization of my MySQL databases. There are 30,000+ records in the Customers database, but the query should have finished by now, right? Well, my best guess is that you should consider indexing your tables... If you haven't done so already, indexing will cause dramatic effect on the speed of the queries... Peter Normann Okay. I've indexed all fields involved, and I've gotten the query time down to under 3 seconds! However, I've discovered a flaw in the query. A customer can order multiple times. The above query still includes customers that have ordered product #23, but have also ordered other products on separate orders. Example: Customers: Subscriptions: +--+---+ +++ | id | bad_email | | customerid | listid | +--+---+ +++ | 1001 | 0 | | 1001 | 2 | +--+---+ +++ Orders: Ordered_Items: +++ +-+---+ | id | customerid | | orderid | productid | +++ +-+---+ | 1 | 1001 | | 1 | 23| | 2 | 1001 | | 2 | 98| +++ +-+---+ Customer #1001 would be included in the found set of the query above. He would be removed because he ordered product #23 on order #1, but he would also be included because he didn't order product #23 on order #2. Any ideas on how to exclude these multi-order customers? Jamie Jamie Tibbetts.[EMAIL PROTECTED] Epigroove .http://www.epigroove.com/ - 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: Need help with a complex query
I don't know if it would be possible to use something like this, but maybe it's worth a try... SELECT Customers.*, SUM(IF(IFNULL(Orders_Items.productid, 0)='23',1,0)) BINGO FROM Customers LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID) LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id (Ordered_Items.productid = '23')) WHERE Customers.id=Subscriptions.customerid AND Subscriptions.listid='2' AND Ordered_Items.orderid IS NULL AND Orders.customerid IS NULL AND NOT Customers.bad_email GROUP BY Customer.email HAVING BINGO = 0; Jeez either I should be getting some coffee or some sleep Peter Normann -Original Message- From: Jamie Tibbetts [mailto:[EMAIL PROTECTED]] Sent: 18. juni 2002 22:21 To: Peter Normann; [EMAIL PROTECTED] Subject: Re: Need help with a complex query Try - and I mean *try* :-) SELECT Customers.* FROM Customers, Subscriptions LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID) LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id (Ordered_Items.productid = '23')) WHERE Customers.id=Subscriptions.customerid AND Subscriptions.listid='2' AND Ordered_Items.orderid IS NULL AND Orders.customerid IS NULL AND NOT Customers.bad_email; Well, MySQL has been chugging on this one for about 15 minutes now, and it's still going. So I'm not sure if it is a problem with the query or the optimization of my MySQL databases. There are 30,000+ records in the Customers database, but the query should have finished by now, right? Well, my best guess is that you should consider indexing your tables... If you haven't done so already, indexing will cause dramatic effect on the speed of the queries... Peter Normann Okay. I've indexed all fields involved, and I've gotten the query time down to under 3 seconds! However, I've discovered a flaw in the query. A customer can order multiple times. The above query still includes customers that have ordered product #23, but have also ordered other products on separate orders. Example: Customers: Subscriptions: +--+---+ +++ | id | bad_email | | customerid | listid | +--+---+ +++ | 1001 | 0 | | 1001 | 2 | +--+---+ +++ Orders: Ordered_Items: +++ +-+---+ | id | customerid | | orderid | productid | +++ +-+---+ | 1 | 1001 | | 1 | 23| | 2 | 1001 | | 2 | 98| +++ +-+---+ Customer #1001 would be included in the found set of the query above. He would be removed because he ordered product #23 on order #1, but he would also be included because he didn't order product #23 on order #2. Any ideas on how to exclude these multi-order customers? Jamie Jamie Tibbetts.[EMAIL PROTECTED] Epigroove .http://www.epigroove.com/ --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 13-06-2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 13-06-2002 - 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: Need help with a complex query
Try - and I mean *try* :-) SELECT Customers.* FROM Customers, Subscriptions LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID) LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id (Ordered_Items.productid = '23')) WHERE Customers.id=Subscriptions.customerid AND Subscriptions.listid='2' AND Ordered_Items.orderid IS NULL AND Orders.customerid IS NULL AND NOT Customers.bad_email; Peter Normann -Original Message- From: Jamie Tibbetts [mailto:[EMAIL PROTECTED]] Sent: 16. juni 2002 18:23 To: [EMAIL PROTECTED] Subject: Need help with a complex query I am currently a web designer who's taught himself the necessary basics of PHP and MySQL. I've reached a point where I can't figure out a complex query. I have a mailing list that customers can sign up for if they want to receive Special Offer mailings when products go on sale. So when it's time to send out a mailing on a sale product, I need to select all customers who have signed up for list #2. However, (and here's the big problem) I need to filter out the customers that have bad email addresses marked in their customer record, *and* I need to filter out the customers who have already purchased the sale product. Customers: Subscriptions: +--+---+ +++ | id | bad_email | | customerid | listid | +--+---+ +++ | 1001 | 1 | | 1001 | 2 | | 1002 | 0 | | 1002 | 1 | | 1003 | 0 | | 1003 | 2 | | 1004 | 0 | | 1004 | 2 | | 1005 | 0 | | 1005 | 2 | +--+---+ +++ Orders: Ordered_Items: +++ +-+---+ | id | customerid | | orderid | productid | +++ +-+---+ | 1 | 1001 | | 1 | 24| | 2 | 1002 | | 2 | 98| | 3 | 1003 | | 3 | 23| | 4 | 1004 | | 4 | 56| +++ +-+---+ For example: I want to send out a mailing on product #23 A) Customer 1001 has a bad email address, so he shouldn't be selected B) Customer 1002 has a good email address, but he's not signed up for list #2, so he shouldn't be selected C) Customer 1003 has a good email address, he's signed up for list #2, but he's ordered product #23 before, so he shouldn't be selected D) Customer 1004 has a good email address, he's signed up for list #2, and he's ordered a product that isn't #23, so he *should* be selected E) Customer 1005 has a good email address, he's signed up for list #2, and he's never ordered, so he *should* be selected Summary: Not Selected: 1001,1002,1003 Selected: 1004,1005 Can anyone create a query that will return the results I need. Keep in mind that I am far from being a MySQL expert, so if you start using too much technical specifics, my head might explode. ;) Thanks in advance! Jamie Jamie Tibbetts.[EMAIL PROTECTED] Epigroove .http://www.epigroove.com/ Success .http://www.success.com/ - 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
Re: Need help with a complex query
Try - and I mean *try* :-) SELECT Customers.* FROM Customers, Subscriptions LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID) LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id (Ordered_Items.productid = '23')) WHERE Customers.id=Subscriptions.customerid AND Subscriptions.listid='2' AND Ordered_Items.orderid IS NULL AND Orders.customerid IS NULL AND NOT Customers.bad_email; Well, MySQL has been chugging on this one for about 15 minutes now, and it's still going. So I'm not sure if it is a problem with the query or the optimization of my MySQL databases. There are 30,000+ records in the Customers database, but the query should have finished by now, right? Jamie Jamie Tibbetts.[EMAIL PROTECTED] Epigroove .http://www.epigroove.com/ - 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: Need help with a complex query
Well, my best guess is that you should consider indexing your tables... If you haven't done so already, indexing will cause dramatic effect on the speed of the queries... Peter Normann -Original Message- From: Jamie Tibbetts [mailto:[EMAIL PROTECTED]] Sent: 16. juni 2002 19:18 To: Peter Normann; [EMAIL PROTECTED] Subject: Re: Need help with a complex query Try - and I mean *try* :-) SELECT Customers.* FROM Customers, Subscriptions LEFT JOIN Orders ON (Orders.customerid=Customer.CustomerID) LEFT JOIN Ordered_Items ON (Ordered_Items.orderid=Orders.id (Ordered_Items.productid = '23')) WHERE Customers.id=Subscriptions.customerid AND Subscriptions.listid='2' AND Ordered_Items.orderid IS NULL AND Orders.customerid IS NULL AND NOT Customers.bad_email; Well, MySQL has been chugging on this one for about 15 minutes now, and it's still going. So I'm not sure if it is a problem with the query or the optimization of my MySQL databases. There are 30,000+ records in the Customers database, but the query should have finished by now, right? Jamie Jamie Tibbetts.[EMAIL PROTECTED] Epigroove .http://www.epigroove.com/ - 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
Re: Need Help with JOIN
Mike, With the way you have it written below, all of the pic1_id, pic2_id, pic3_id, and pic4_id must be equal (because they all equal pic.pic_id). Since this wasn't true for any of the rows, that is why you were getting no results. To get each picture value seperately, you will have to do one join for each pic#_id, which will give you something like: SELECT * FROM pics AS p1, pics AS p2, pics AS p3, pics AS p4 , outings AS o WHERE o.pic1_id=p1.pic_id AND o.pic2_id=p2.pic_id AND o.pic3_id=p3.pic_id AND o.pic4_id=p4.pic_id; Or as you had it written before using INNER JOIN's: SELECT * FROM outings as o INNER JOIN pics AS p1 ON o.pic1_id=p1.pic_id INNER JOIN pics AS p2 ON o.pic2_id=p2.pic_id INNER JOIN pics AS p3 ON o.pic3_id=p3.pic_id INNER JOIN pics AS p4 ON o.pic4_id=p4.pic_id; Either of those should work fairly well. Hope that helps some. Harrison Mike wrote: Hello, I have 2 tables(pics and outings) pics pic_id, tinyint path, varchar outings outings_id, tinyint pic1_id, tinyint pic2_id, tinyint pic3_id, tinyint pic4_id, tinyint When i try to do a join like this mysql_query(SELECT * FROM pics inner join outings on outings.pic1_id=pic.pic_id and outings.pic2_id=pic.pic_id and outings.pic3_id=pic.pic_id,$db) or die(mysql_error()); Nothing is returned. The query runs ok(nothing from mysql_error). When I drop outings.pic2_id=pic.pic_id and outings.pic3_id=pic.pic_id from the query works and returns the path of the pic. I'm fairly certain that the above returns nothing because of the multiple pic.pic_id's in the query. But I don't know what to do get it working(Redesign? or Is there something I could change in the query?) Thanks in advance for any help, Mike sql,mysql --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 - 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
Re: Need Help with JOIN
Thanks for the help. Got that to work no problem. Mike - Original Message - From: Harrison C. Fisk [EMAIL PROTECTED] To: Mike [EMAIL PROTECTED] Cc: mysql list [EMAIL PROTECTED] Sent: Thursday, June 13, 2002 5:48 PM Subject: Re: Need Help with JOIN Mike, With the way you have it written below, all of the pic1_id, pic2_id, pic3_id, and pic4_id must be equal (because they all equal pic.pic_id). Since this wasn't true for any of the rows, that is why you were getting no results. To get each picture value seperately, you will have to do one join for each pic#_id, which will give you something like: SELECT * FROM pics AS p1, pics AS p2, pics AS p3, pics AS p4 , outings AS o WHERE o.pic1_id=p1.pic_id AND o.pic2_id=p2.pic_id AND o.pic3_id=p3.pic_id AND o.pic4_id=p4.pic_id; Or as you had it written before using INNER JOIN's: SELECT * FROM outings as o INNER JOIN pics AS p1 ON o.pic1_id=p1.pic_id INNER JOIN pics AS p2 ON o.pic2_id=p2.pic_id INNER JOIN pics AS p3 ON o.pic3_id=p3.pic_id INNER JOIN pics AS p4 ON o.pic4_id=p4.pic_id; Either of those should work fairly well. Hope that helps some. Harrison Mike wrote: Hello, I have 2 tables(pics and outings) pics pic_id, tinyint path, varchar outings outings_id, tinyint pic1_id, tinyint pic2_id, tinyint pic3_id, tinyint pic4_id, tinyint When i try to do a join like this mysql_query(SELECT * FROM pics inner join outings on outings.pic1_id=pic.pic_id and outings.pic2_id=pic.pic_id and outings.pic3_id=pic.pic_id,$db) or die(mysql_error()); Nothing is returned. The query runs ok(nothing from mysql_error). When I drop outings.pic2_id=pic.pic_id and outings.pic3_id=pic.pic_id from the query works and returns the path of the pic. I'm fairly certain that the above returns nothing because of the multiple pic.pic_id's in the query. But I don't know what to do get it working(Redesign? or Is there something I could change in the query?) Thanks in advance for any help, Mike sql,mysql --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 - 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 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 - 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: Need help.
Hi, Any problem is an effect of the cause so... I keep getting errors involving resolveip when I install, or it just don't work. When I try to run the ./configure command in Linux (7.1-7.3), it kicks me back an error. What error? If I use the rpm installation, it seems to install fine, but when I go to access the db from anywhere, it never works. For sure you must set privileges for the user which must connected from other host. I've followed the directions on the web site, other web sites and even from a book that I bought (MySQL and mSQL from O'Reilly), none of the directions seem to work. What the heck am I doing wrong? BTW, we need the supported commands in 4.0.x and 4.1.x, so we're trying to start with 4.0.1-2 right now, so that the changes we have to make will be minimal when 4.0.x becomes stable and 4.1.x becomes stable. Any help would be appreciated. Thanks, Matt Regards, Gelu - 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
Re: Need help
Hi, I have a MySQL database with a table named CONNEXION. When i'm trying to do something with the specific table, i have the following error: ERROR1016:Can't open file: 'CONNEXION.MYD'. (errno: 145) Please can anybody help me? Thanks in advance -- ** Bertrand TACHAGOE_mails: [EMAIL PROTECTED] / [EMAIL PROTECTED] Network / information specialist SDNP SchoolNet Cameroon Phone: (237)221 25 53 Web site: www.sdnp.cm/tachago ** - 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: Need help
Use perror program to see what the error code means.. perror 145 Error code 145: Unknown error 145 145 = Table was marked as crashed and should be repaired Repair your table.. see: http://www.mysql.com/doc/R/E/REPAIR_TABLE.html Gurhan -Original Message- From: Bertrand TACHAGO [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 9:16 AM To: [EMAIL PROTECTED] Subject: Re: Need help Hi, I have a MySQL database with a table named CONNEXION. When i'm trying to do something with the specific table, i have the following error: ERROR1016:Can't open file: 'CONNEXION.MYD'. (errno: 145) Please can anybody help me? Thanks in advance -- ** Bertrand TACHAGOE_mails: [EMAIL PROTECTED] / [EMAIL PROTECTED] Network / information specialist SDNP SchoolNet Cameroon Phone: (237)221 25 53 Web site: www.sdnp.cm/tachago ** - 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
Re: Re: Need help
Bertrand, Tuesday, May 21, 2002, 4:15:37 PM, you wrote: BT I have a MySQL database with a table named CONNEXION. When i'm trying to do BT something with the specific table, i have the following error: BT ERROR1016:Can't open file: 'CONNEXION.MYD'. (errno: 145) BT Please can anybody help me? BT Thanks in advance # perror 145 Error code 145: Unknown error 145 145 = Table was marked as crashed and should be repaired Try to repair table using myisamchk or REPAIR TABLE. Look at: http://www.mysql.com/doc/R/e/Repair.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: Need help
Thanks, i had check and had already solve the problem. Gurhan Ozen [EMAIL PROTECTED] a dit : Use perror program to see what the error code means.. perror 145 Error code 145: Unknown error 145 145 = Table was marked as crashed and should be repaired Repair your table.. see: http://www.mysql.com/doc/R/E/REPAIR_TABLE.html Gurhan -Original Message- From: Bertrand TACHAGO [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 9:16 AM To: [EMAIL PROTECTED] Subject: Re: Need help Hi, I have a MySQL database with a table named CONNEXION. When i'm trying to do something with the specific table, i have the following error: ERROR1016:Can't open file: 'CONNEXION.MYD'. (errno: 145) Please can anybody help me? Thanks in advance -- ** Bertrand TACHAGO E_mails: [EMAIL PROTECTED] / [EMAIL PROTECTED] Network / information specialist SDNP SchoolNet Cameroon Phone: (237)221 25 53 Web site: www.sdnp.cm/tachago ** - 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 -- ** Bertrand TACHAGOE_mails: [EMAIL PROTECTED] / [EMAIL PROTECTED] Network / information specialist SDNP SchoolNet Cameroon Phone: (237)221 25 53 Web site: www.sdnp.cm/tachago ** - 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: need help debugging!
Hello Alex, If the mysql query returns 0 then it will display the message like this -Uma On Fri, 1 Mar 2002, Alex Behrens wrote: ABHey All, AB ABI am new to mysql and I need help debugging this peice of code for my site: AB AB?php AB$db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); ABmysql_select_db(rahs,$db); AB$search = mysql_query(SELECT * FROM rahs); ABwhile($num=mysql_fetch_array($search)) { ABprintf (div align='center'centertable border='0' cellpadding='0' ABcellspacing='0' width=\40%\trtd ABwidth=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd ABwidth=\30%\Team: %s/td/trtrtd width=\100%\ colspan='2'Penalty: AB%s/td/trtrtd width=\50%\Groundballs: %s/tdtd ABwidth=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs ABWon:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd ABwidth=\100%\ colspan='2'p ABalign='center'Date:%s/td/tr/table/center/div,$num[name],$num[ ABnumber],$num[team],$num[penalty],$num[groundballs],$num[shots],$num AB[faceoffs_won],$num[faceoffs_lost],$num[date]); AB} AB? AB ABit says this error: ABWarning: Supplied argument is not a valid MySQL result resource on line 17 ABline 17 would be this line: ABwhile($num=mysql_fetch_array($search)) { AB ABwhat is wrong with my code? AB AB ABThanks! AB AB-Alex Big Al Behrens ABE-mail: [EMAIL PROTECTED] ABUrgent E-mail: [EMAIL PROTECTED] (Please be brief!) ABPhone: 651-482-8779 ABCell: 651-329-4187 ABFax: 651-482-1391 ABICQ: 3969599 ABOwner of the 3D-Unlimited Network: ABhttp://www.3d-unlimited.com ABSend News: AB[EMAIL PROTECTED] AB AB AB- ABBefore posting, please check: AB http://www.mysql.com/manual.php (the manual) AB http://lists.mysql.com/ (the list archive) AB ABTo request this thread, e-mail [EMAIL PROTECTED] ABTo unsubscribe, e-mail [EMAIL PROTECTED] ABTrouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php AB -- Love and you shall be loved by others - 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: need help debugging!
how do I fix it so mysql doesn't returns a 0? is my syntax wrong somewhere? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Uma Shankari T. [EMAIL PROTECTED] To: Alex Behrens [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 01, 2002 7:35 PM Subject: Re: need help debugging! Hello Alex, If the mysql query returns 0 then it will display the message like this -Uma On Fri, 1 Mar 2002, Alex Behrens wrote: ABHey All, AB ABI am new to mysql and I need help debugging this peice of code for my site: AB AB?php AB$db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); ABmysql_select_db(rahs,$db); AB$search = mysql_query(SELECT * FROM rahs); ABwhile($num=mysql_fetch_array($search)) { ABprintf (div align='center'centertable border='0' cellpadding='0' ABcellspacing='0' width=\40%\trtd ABwidth=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd ABwidth=\30%\Team: %s/td/trtrtd width=\100%\ colspan='2'Penalty: AB%s/td/trtrtd width=\50%\Groundballs: %s/tdtd ABwidth=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs ABWon:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd ABwidth=\100%\ colspan='2'p ABalign='center'Date:%s/td/tr/table/center/div,$num[name],$nu m[ ABnumber],$num[team],$num[penalty],$num[groundballs],$num[shots],$ num AB[faceoffs_won],$num[faceoffs_lost],$num[date]); AB} AB? AB ABit says this error: ABWarning: Supplied argument is not a valid MySQL result resource on line 17 ABline 17 would be this line: ABwhile($num=mysql_fetch_array($search)) { AB ABwhat is wrong with my code? AB AB ABThanks! AB AB-Alex Big Al Behrens ABE-mail: [EMAIL PROTECTED] ABUrgent E-mail: [EMAIL PROTECTED] (Please be brief!) ABPhone: 651-482-8779 ABCell: 651-329-4187 ABFax: 651-482-1391 ABICQ: 3969599 ABOwner of the 3D-Unlimited Network: ABhttp://www.3d-unlimited.com ABSend News: AB[EMAIL PROTECTED] AB AB AB- ABBefore posting, please check: AB http://www.mysql.com/manual.php (the manual) AB http://lists.mysql.com/ (the list archive) AB ABTo request this thread, e-mail [EMAIL PROTECTED] ABTo unsubscribe, e-mail [EMAIL PROTECTED] ABTrouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php AB -- Love and you shall be loved by others - 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: need help debugging!
Hello Alex, Check it manually wheather ur query returns any row. -Uma On Fri, 1 Mar 2002, Alex Behrens wrote: ABhow do I fix it so mysql doesn't returns a 0? is my syntax wrong somewhere? AB ABThanks! AB AB-Alex Big Al Behrens ABE-mail: [EMAIL PROTECTED] ABUrgent E-mail: [EMAIL PROTECTED] (Please be brief!) ABPhone: 651-482-8779 ABCell: 651-329-4187 ABFax: 651-482-1391 ABICQ: 3969599 ABOwner of the 3D-Unlimited Network: ABhttp://www.3d-unlimited.com ABSend News: AB[EMAIL PROTECTED] AB- Original Message - ABFrom: Uma Shankari T. [EMAIL PROTECTED] ABTo: Alex Behrens [EMAIL PROTECTED] ABCc: [EMAIL PROTECTED] ABSent: Friday, March 01, 2002 7:35 PM ABSubject: Re: need help debugging! AB AB AB AB Hello Alex, AB AB AB If the mysql query returns 0 then it will display the message like this AB AB AB -Uma AB AB AB On Fri, 1 Mar 2002, Alex Behrens wrote: AB AB ABHey All, AB AB AB ABI am new to mysql and I need help debugging this peice of code for my ABsite: AB AB AB AB?php AB AB$db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); AB ABmysql_select_db(rahs,$db); AB AB$search = mysql_query(SELECT * FROM rahs); AB ABwhile($num=mysql_fetch_array($search)) { AB ABprintf (div align='center'centertable border='0' cellpadding='0' AB ABcellspacing='0' width=\40%\trtd AB ABwidth=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd AB ABwidth=\30%\Team: %s/td/trtrtd width=\100%\ ABcolspan='2'Penalty: AB AB%s/td/trtrtd width=\50%\Groundballs: %s/tdtd AB ABwidth=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs AB ABWon:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd AB ABwidth=\100%\ colspan='2'p AB ABABalign='center'Date:%s/td/tr/table/center/div,$num[name],$nu ABm[ AB ABABnumber],$num[team],$num[penalty],$num[groundballs],$num[shots],$ ABnum AB AB[faceoffs_won],$num[faceoffs_lost],$num[date]); AB AB} AB AB? AB AB AB ABit says this error: AB ABWarning: Supplied argument is not a valid MySQL result resource on line AB17 AB ABline 17 would be this line: AB ABwhile($num=mysql_fetch_array($search)) { AB AB AB ABwhat is wrong with my code? AB AB AB AB AB ABThanks! AB AB AB AB-Alex Big Al Behrens AB ABE-mail: [EMAIL PROTECTED] AB ABUrgent E-mail: [EMAIL PROTECTED] (Please be brief!) AB ABPhone: 651-482-8779 AB ABCell: 651-329-4187 AB ABFax: 651-482-1391 AB ABICQ: 3969599 AB ABOwner of the 3D-Unlimited Network: AB ABhttp://www.3d-unlimited.com AB ABSend News: AB AB[EMAIL PROTECTED] AB AB AB AB AB AB- AB ABBefore posting, please check: AB AB http://www.mysql.com/manual.php (the manual) AB AB http://lists.mysql.com/ (the list archive) AB AB AB ABTo request this thread, e-mail [EMAIL PROTECTED] AB ABTo unsubscribe, e-mail AB[EMAIL PROTECTED] AB ABTrouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php AB AB AB AB -- AB AB Love and you shall be loved by others AB AB AB AB AB- ABBefore posting, please check: AB http://www.mysql.com/manual.php (the manual) AB http://lists.mysql.com/ (the list archive) AB ABTo request this thread, e-mail [EMAIL PROTECTED] ABTo unsubscribe, e-mail [EMAIL PROTECTED] ABTrouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php AB -- Love and you shall be loved by others - 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: need help debugging!
what do you mean by checking each query manually? how do I do this? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Uma Shankari T. [EMAIL PROTECTED] To: Alex Behrens [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 01, 2002 7:59 PM Subject: Re: need help debugging! Hello Alex, Check it manually wheather ur query returns any row. -Uma On Fri, 1 Mar 2002, Alex Behrens wrote: ABhow do I fix it so mysql doesn't returns a 0? is my syntax wrong somewhere? AB ABThanks! AB AB-Alex Big Al Behrens ABE-mail: [EMAIL PROTECTED] ABUrgent E-mail: [EMAIL PROTECTED] (Please be brief!) ABPhone: 651-482-8779 ABCell: 651-329-4187 ABFax: 651-482-1391 ABICQ: 3969599 ABOwner of the 3D-Unlimited Network: ABhttp://www.3d-unlimited.com ABSend News: AB[EMAIL PROTECTED] AB- Original Message - ABFrom: Uma Shankari T. [EMAIL PROTECTED] ABTo: Alex Behrens [EMAIL PROTECTED] ABCc: [EMAIL PROTECTED] ABSent: Friday, March 01, 2002 7:35 PM ABSubject: Re: need help debugging! AB AB AB AB Hello Alex, AB AB AB If the mysql query returns 0 then it will display the message like this AB AB AB -Uma AB AB AB On Fri, 1 Mar 2002, Alex Behrens wrote: AB AB ABHey All, AB AB AB ABI am new to mysql and I need help debugging this peice of code for my ABsite: AB AB AB AB?php AB AB$db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); AB ABmysql_select_db(rahs,$db); AB AB$search = mysql_query(SELECT * FROM rahs); AB ABwhile($num=mysql_fetch_array($search)) { AB ABprintf (div align='center'centertable border='0' cellpadding='0' AB ABcellspacing='0' width=\40%\trtd AB ABwidth=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd AB ABwidth=\30%\Team: %s/td/trtrtd width=\100%\ ABcolspan='2'Penalty: AB AB%s/td/trtrtd width=\50%\Groundballs: %s/tdtd AB ABwidth=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs AB ABWon:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd AB ABwidth=\100%\ colspan='2'p AB ABABalign='center'Date:%s/td/tr/table/center/div,$num[name], $nu ABm[ AB ABABnumber],$num[team],$num[penalty],$num[groundballs],$num[shots ],$ ABnum AB AB[faceoffs_won],$num[faceoffs_lost],$num[date]); AB AB} AB AB? AB AB AB ABit says this error: AB ABWarning: Supplied argument is not a valid MySQL result resource on line AB17 AB ABline 17 would be this line: AB ABwhile($num=mysql_fetch_array($search)) { AB AB AB ABwhat is wrong with my code? AB AB AB AB AB ABThanks! AB AB AB AB-Alex Big Al Behrens AB ABE-mail: [EMAIL PROTECTED] AB ABUrgent E-mail: [EMAIL PROTECTED] (Please be brief!) AB ABPhone: 651-482-8779 AB ABCell: 651-329-4187 AB ABFax: 651-482-1391 AB ABICQ: 3969599 AB ABOwner of the 3D-Unlimited Network: AB ABhttp://www.3d-unlimited.com AB ABSend News: AB AB[EMAIL PROTECTED] AB AB AB AB AB AB- AB ABBefore posting, please check: AB AB http://www.mysql.com/manual.php (the manual) AB AB http://lists.mysql.com/ (the list archive) AB AB AB ABTo request this thread, e-mail [EMAIL PROTECTED] AB ABTo unsubscribe, e-mail AB[EMAIL PROTECTED] AB ABTrouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php AB AB AB AB -- AB AB Love and you shall be loved by others AB AB AB AB AB- ABBefore posting, please check: AB http://www.mysql.com/manual.php (the manual) AB http://lists.mysql.com/ (the list archive) AB ABTo request this thread, e-mail [EMAIL PROTECTED] ABTo unsubscribe, e-mail [EMAIL PROTECTED] ABTrouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php AB -- Love and you shall be loved by others - 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: need help debugging!
rahs is the name of your db and your table? It's a good idea to check for errors as you go. Try something like: ?php $db = mysql_connect(db30.pair.com, net3dual, rosevilleX1) or die(Couldn't connect: .mysql_error()); mysql_select_db(rahs,$db) or die(Couldn't select db: .mysql_error()); $search = mysql_query(SELECT * FROM rahs) or die(Query failed :.mysql_error()); while($num=mysql_fetch_array($search)) { ... Also, if that's your real user and password in the mysql_connect, you should change it now, as this is an open list. Michael On Fri, 1 Mar 2002, Alex Behrens wrote: how do I fix it so mysql doesn't returns a 0? is my syntax wrong somewhere? Thanks! -Alex Big Al Behrens - Original Message - From: Uma Shankari T. [EMAIL PROTECTED] Hello Alex, If the mysql query returns 0 then it will display the message like this -Uma On Fri, 1 Mar 2002, Alex Behrens wrote: ABHey All, AB ABI am new to mysql and I need help debugging this peice of code for my site: AB AB?php AB$db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); ABmysql_select_db(rahs,$db); AB$search = mysql_query(SELECT * FROM rahs); ABwhile($num=mysql_fetch_array($search)) { ABprintf (div align='center'centertable border='0' cellpadding='0' ABcellspacing='0' width=\40%\trtd ABwidth=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd ABwidth=\30%\Team: %s/td/trtrtd width=\100%\ colspan='2'Penalty: AB%s/td/trtrtd width=\50%\Groundballs: %s/tdtd ABwidth=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs ABWon:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd ABwidth=\100%\ colspan='2'p ABalign='center'Date:%s/td/tr/table/center/div,$num[name],$nu m[ ABnumber],$num[team],$num[penalty],$num[groundballs],$num[shots],$ num AB[faceoffs_won],$num[faceoffs_lost],$num[date]); AB} AB? AB ABit says this error: ABWarning: Supplied argument is not a valid MySQL result resource on line 17 ABline 17 would be this line: ABwhile($num=mysql_fetch_array($search)) { AB ABwhat is wrong with my code? AB AB ABThanks! Michael Stassen University Information Technology Services Indiana University Bloomington [EMAIL PROTECTED] - 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: need help debugging!
Try adding this to your mysql_query() function. $search = mysql_query() or die(ERROR: . mysql_error() . ( . mysql_errno(). )); this will tell you whether or not the query is dieing for one reason or another. if it doesn't return the die() statement then you must assume that it was successfull. the best way to catch whether or not the result pointer is empty, is to run a mysql_num_rows() on the pointer. this will return to you the total number of rows returned by the select statement. if you wrap your while clause with an if statement and have the condition be whether or not the returned value of the mysql_num_rows() is greater then zero. upon failing, returning zero results, it will never run the while loop, therefor never give you the error that it's tring to use an invalid result pointer. So, try this ?php $db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); $db = mysql_select_db(rahs,$db); $search = mysql_query(SELECT * FROM rahs) or die(ERROR: . mysql_error() . ( . mysql_errno(). )); if(mysql_num_rows($search)) { while($num = mysql_fetch_array($search)) { echo div align='center' table border='0' cellpadding='0' cellspacing='0' width=\40%\ align='center' tr td width=\70%\Name: .$num[name]. nbsp;nbsp;nbsp;nbsp; #.$num[number]./td td width=\30%\Team: .$num[team]./td /tr tr td width=\100%\ colspan='2'Penalty.$num[penalty]./td /tr tr td width=\50%\Groundballs: .$num[groundballs]./td td width=\50%\Shots: .$num[shots]./td /tr tr td width=\50%\Faceoffs Won: .$num[faceoffs_won]./td td width=\50%\Faceoffs Lost: .$num[faceoffs_lost]./td /tr tr td width=\100%\ colspan='2'p align='center'Date .$num[date]./p/td /tr /table /div; } } else { die(didn't find any results); } ? - Original Message - From: Alex Behrens [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 01, 2002 5:25 PM Subject: need help debugging! Hey All, I am new to mysql and I need help debugging this peice of code for my site: ?php $db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); mysql_select_db(rahs,$db); $search = mysql_query(SELECT * FROM rahs); while($num=mysql_fetch_array($search)) { printf (div align='center'centertable border='0' cellpadding='0' cellspacing='0' width=\40%\trtd width=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd width=\30%\Team: %s/td/trtrtd width=\100%\ colspan='2'Penalty: %s/td/trtrtd width=\50%\Groundballs: %s/tdtd width=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs Won:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd width=\100%\ colspan='2'p align='center'Date:%s/td/tr/table/center/div,$num[name],$num[ number],$num[team],$num[penalty],$num[groundballs],$num[shots],$num [faceoffs_won],$num[faceoffs_lost],$num[date]); } ? it says this error: Warning: Supplied argument is not a valid MySQL result resource on line 17 line 17 would be this line: while($num=mysql_fetch_array($search)) { what is wrong with my code? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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
Re: need help debugging! (more!)
Actually I figured out the problem my db name was wrong, however I am getting a new code, here is my code now tho and the error (with the pass this time!): ?php $db = mysql_connect(db, ***, ***); mysql_select_db(net3dual_lax,$db); $search = mysql_query(SELECT * FROM rahs); echo div align='center'centertable border='0' cellpadding='0' cellspacing='0' width=\40%\\n; while($num=mysql_fetch_array($search)) { printf (trtd width=\70%\Name:%snbsp;nbsp;nbsp;nbsp; Number:%s/tdtd width=\30%\Team: %s/td/trtrtd width=\100%\ colspan='2'Penalty: %s/td/trtrtd width=\50%\Groundballs: %s/tdtd width=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs Won:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd width=\100%\ colspan='2'p align='center'Date:%s/td/tr/table/center/div,$num[name],$num[ number],$num[team],$num[penalty],$num[groundballs],$num[shots],$num [faceoffs_won],$num[faceoffs_lost],$num[date]); } ? it gives me this error: Warning: printf(): too few arguments how do I fix this? I checked the number of %s and the number of $num arguments and they shuld match. what am I doing wrong? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Jim Lucas [jimmysql] [EMAIL PROTECTED] To: Alex Behrens [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 01, 2002 10:19 PM Subject: Re: need help debugging! Try adding this to your mysql_query() function. $search = mysql_query() or die(ERROR: . mysql_error() . ( . mysql_errno(). )); this will tell you whether or not the query is dieing for one reason or another. if it doesn't return the die() statement then you must assume that it was successfull. the best way to catch whether or not the result pointer is empty, is to run a mysql_num_rows() on the pointer. this will return to you the total number of rows returned by the select statement. if you wrap your while clause with an if statement and have the condition be whether or not the returned value of the mysql_num_rows() is greater then zero. upon failing, returning zero results, it will never run the while loop, therefor never give you the error that it's tring to use an invalid result pointer. So, try this ?php $db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); $db = mysql_select_db(rahs,$db); $search = mysql_query(SELECT * FROM rahs) or die(ERROR: . mysql_error() . ( . mysql_errno(). )); if(mysql_num_rows($search)) { while($num = mysql_fetch_array($search)) { echo div align='center' table border='0' cellpadding='0' cellspacing='0' width=\40%\ align='center' tr td width=\70%\Name: .$num[name]. nbsp;nbsp;nbsp;nbsp; #.$num[number]./td td width=\30%\Team: .$num[team]./td /tr tr td width=\100%\ colspan='2'Penalty.$num[penalty]./td /tr tr td width=\50%\Groundballs: .$num[groundballs]./td td width=\50%\Shots: .$num[shots]./td /tr tr td width=\50%\Faceoffs Won: .$num[faceoffs_won]./td td width=\50%\Faceoffs Lost: .$num[faceoffs_lost]./td /tr tr td width=\100%\ colspan='2'p align='center'Date .$num[date]./p/td /tr /table /div; } } else { die(didn't find any results); } ? - Original Message - From: Alex Behrens [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 01, 2002 5:25 PM Subject: need help debugging! Hey All, I am new to mysql and I need help debugging this peice of code for my site: ?php $db = mysql_connect(db30.pair.com, net3dual, rosevilleX1); mysql_select_db(rahs,$db); $search = mysql_query(SELECT * FROM rahs); while($num=mysql_fetch_array($search)) { printf (div align='center'centertable border='0' cellpadding='0' cellspacing='0' width=\40%\trtd width=\70%\Name:%snbsp;nbsp;nbsp;nbsp; #%s/tdtd width=\30%\Team: %s/td/trtrtd width=\100%\ colspan='2'Penalty: %s/td/trtrtd width=\50%\Groundballs: %s/tdtd width=\50%\Shots: %s/td/trtrtd width=\50%\Faceoffs Won:%s/tdtd width=\50%\Faceoffs Lost: %s/td/trtrtd width=\100%\ colspan='2'p align='center'Date:%s/td/tr/table/center/div,$num[name],$num[ number
Re: Need help about mysql order and index....
Okay is not a reply for myself :) is only for add a question... :) I read that mysql 4 will fix this, but mysql 4 is stable? I mean i'm on production, i'm not selling mysql :) I mean I have a big projet in test using mysql.. so if it crash it will be very bad for me... someone had test mysql 4? stable or not? :) Jean-Francois Dionne - Original Message - From: Jean-Francois Dionne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:25 PM Subject: Need help about mysql order and index Hi there, I hope someone will can help me... First, sorry for bad english :) i'm french First all I have those index in my table +---+---+-++ --+-++--++ -- + | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Comment | +---+---+-++ --+-++--++ -- + | Stats | 0 | PRIMARY |1| ID | A | 4568748 | NULL | NULL| | | Stats | 1 | Port_ID |1| Port_ID | A | 1 | NULL | NULL| | | Stats | 1 | Timestamp |1| Timestamp | A | 49126 | NULL | NULL| | +---+---+-++ --+-++--++ -- + You have to know I have 4 500 000 in my db Okay I have this query: select Timestamp from Stats use index (Timestamp) where Timestamp = '2002-01-01' and Timestamp '2002-02-01' order by Timestamp limit 1; this one is jsut doing fine.. it take 0.00 sec to do it... but select Timestamp from Stats use index (Timestamp) where Timestamp = '2002-01-01' and Timestamp '2002-02-01' order by Timestamp desc limit 1; this one take sometime 10 sec to do I understand is the desc the prob.. because my index is in asc (collation=A) my question is... is there a way for maiking a index in desc? or maybe something else? Jean-Francois Dionne Yard - 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
Re: Need help about mysql order and index....
Bonjour Jean-françois, Le DESC qui utilise l'INDEX est un fonction de MySQL 4.0. Il y a un bug en la version 4.0.1 (Quelque fois il n'utilise pas l'index descendre ) mais pour la plus part ça marche bien. En autre il y a un forum de MySQL en français à: Liens utils : Poster un message: [EMAIL PROTECTED] S'abonner: [EMAIL PROTECTED] Se désabonner : [EMAIL PROTECTED] Ecrire au proprio : [EMAIL PROTECTED] URL sur Onelist : http://www.onelist.com/community/mysql-france Bonne chance, Amicalement, Ken - Original Message - From: Jean-Francois Dionne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:25 PM Subject: Need help about mysql order and index Hi there, I hope someone will can help me... First, sorry for bad english :) i'm french First all I have those index in my table +---+---+-++-- -- --+-++--+--- -+-- + | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Comment | +---+---+-++-- -- --+-++--+--- -+-- + | Stats | 0 | PRIMARY |1| ID | A | 4568748 | NULL | NULL| | | Stats | 1 | Port_ID |1| Port_ID | A | 1 | NULL | NULL| | | Stats | 1 | Timestamp |1| Timestamp | A | 49126 | NULL | NULL| | +---+---+-++-- -- --+-++--+--- -+-- + You have to know I have 4 500 000 in my db Okay I have this query: select Timestamp from Stats use index (Timestamp) where Timestamp = '2002-01-01' and Timestamp '2002-02-01' order by Timestamp limit 1; this one is jsut doing fine.. it take 0.00 sec to do it... but select Timestamp from Stats use index (Timestamp) where Timestamp = '2002-01-01' and Timestamp '2002-02-01' order by Timestamp desc limit 1; this one take sometime 10 sec to do I understand is the desc the prob.. because my index is in asc (collation=A) my question is... is there a way for maiking a index in desc? or maybe something else? Jean-Francois Dionne Yard - 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
Re: Need help please!
On Thu, Feb 14, 2002 at 01:05:24PM -0500, Richard C Rossy wrote: Ok I can't seem to get this. Now is it possible to have MySQL on a other computer and run the script. In other words the perl script is on foo.com and MySQL database is on foo2.com. What is need to make the script work. What I have in the script is: Have you actually read the perl docs for DBI? DBI Class Methods ... connect $dbh = DBI-connect($data_source, $username, $password) or die $DBI::errstr; ... Examples of $data_source values are: dbi:DriverName:database_name dbi:DriverName:database_name@hostname:port dbi:DriverName:database=database_name;host=hostname;port=port There is no standard for the text following the driver name. Each driver is free to use whatever syntax it wants. So - compare the documentation with what your effort was, and note the difference: $dbh = DBI-connect(DBI:mysql:$mysqldatabase, $mysqlhost,$mysqlusername, $mysqlpassword) || die(Couldn't connect to database!\n); -- Brian 'you Bastard' Reichert[EMAIL PROTECTED] 37 Crystal Ave. #303Daytime number: (603) 434-6842 Derry NH 03038-1713 USA Intel architecture: the left-hand path - 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: Need Help bad!.. today.. of all days!
hope you version came out better thn mine.. in my mail it was all out of shape.. maybe could attach a text file.. doubt the list allows that thoough alot dont Upload it as your_code_name.txt to your website and send an URL to the list. filter: mysql query sql Bye, B. - 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: Need Help bad!.. today.. of all days!
I think you need to post the code. The description of the problem is a bit ambiguous. _justin Webmaster wrote: Hello.. of all days i have a project thats to be shown tomorrow. i cannot get the dam thing to work it should be simple i'd think i would post code and all and if asked will but it comes down to this.. i am using php 4 and mysql.. and doing math i have say 40 entries in the database, 20 for two differant surveys.. anytime anew person fills out the survey they get a unique id i have it set to grabe the results from each unigue id for each question through mysql.. but it seems to stop shot about 4 questions.. i even tried dropped the while loop 4 questions shorter -4 and it still stop the same place.. of all days for this to occure.. i know but if anyone has a clue please offer suggestions.. also plase cc [EMAIL PROTECTED] with your reply.. thanks -- Your Guardian Angel... find out here http://www.angelhaven.com/aodmail/ Come Cruisin with the Angels http://www.AngelCruise.com Sign up for your free AngelHaven E-mail Today http://www.angelhaven.com/mail/ - 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 -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 - 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: Need Help bad!.. today.. of all days!
the code is huge i'll post whats relevant. there may be a few irrelevant things in there... but hell... if your willing to look i'm willing to post i know what works so will skip down lower to prevent wasting your time and if ya could please cc your responce to [EMAIL PROTECTED], though if to much trouble i understand i thought i was close.. but then compared the data and it doesnt match.. for instance its spitting out the right subcluters.. and untill i asked for the coomparison it was fine.. i cant do a percentage match or trial till it gives right info.. while($i_sub$num_sub){ $sub_id = @mysql_result($result_sub,$i_sub,subcluster_id); $result_per = mysql_query(select ques_ans from data_1 where ass_id=$ass_id AND user_id=$user_id AND subcluster_id='$sub_id',$db); $num_per = mysql_num_rows($result_per); $i_per=0; //this seems wrong but will count all subclusters equally 1 at a time through the while should $i_per1 = 0; // need a double count so need two seperate $cper = 0; while($i_per$num_per){ // so we need to run the while, probably need to cut the ending out here to add to end of total //gonna change this into an include so its not listed 3 times here-maybe // do math function $nper = $num_per; $nper2 = ($nper*5); // max reading to devide by //answer = // need to add all the answers here while($i_per1$num_per){ $cper = $cper; $cper1 = @mysql_result($result_per,$i_per1,ques_ans); $i_per1++; $cper2 = @mysql_result($result_per,$i_per1,ques_ans); $cper = ($cper+$cper1+$cper2); // $cper3 = $cper; // this is just an easy extraction // i think this actualy might work echo sub=$sub_id = $cperp; $i_per1++;}; // this should loop through output to count the results total //TEST //echo cper3 = $cper3; $i_per++; }; $i_sub++;}; i know theres some redundant code in there etc.. but hey.. till it works i dont like to delete -- Original Message -- From: Justin Farnsworth [EMAIL PROTECTED] Date: Tue, 25 Dec 2001 09:28:53 -0500 I think you need to post the code. The description of the problem is a bit ambiguous. _justin Webmaster wrote: Hello.. of all days i have a project thats to be shown tomorrow. i cannot get the dam thing to work it should be simple i'd think i would post code and all and if asked will but it comes down to this.. i am using php 4 and mysql.. and doing math i have say 40 entries in the database, 20 for two differant surveys.. anytime anew person fills out the survey they get a unique id i have it set to grabe the results from each unigue id for each question through mysql.. but it seems to stop shot about 4 questions.. i even tried dropped the while loop 4 questions shorter -4 and it still stop the same place.. of all days for this to occure.. i know but if anyone has a clue please offer suggestions.. also plase cc [EMAIL PROTECTED] with your reply.. thanks
Re: Need Help bad!.. today.. of all days!
hope you version came out better thn mine.. in my mail it was all out of shape.. maybe could attach a text file.. doubt the list allows that thoough alot dont -- Original Message -- From: Webmaster [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Tue, 25 Dec 2001 09:53:50 -0500 the code is huge i'll post whats relevant. there may be a few irrelevant things in there... but hell... if your willing to look i'm willing to post i know what works so will skip down lower to prevent wasting your time and if ya could please cc your responce to [EMAIL PROTECTED], though if to much trouble i understand i thought i was close.. but then compared the data and it doesnt match.. for instance its spitting out the right subcluters.. and untill i asked for the coomparison it was fine.. i cant do a percentage match or trial till it gives right info.. while($i_sub$num_sub){ $sub_id = @mysql_result($result_sub,$i_sub,subcluster_id); $result_per = mysql_query(select ques_ans from data_1 where ass_id=$ass_id AND user_id=$user_id AND subcluster_id='$sub_id',$db); $num_per = mysql_num_rows($result_per); $i_per=0; //this seems wrong but will count all subclusters equally 1 at a time through the while should $i_per1 = 0; // need a double count so need two seperate $cper = 0; while($i_per$num_per){ // so we need to run the while, probably need to cut the ending out here to add to end of total //gonna change this into an include so its not listed 3 times here-maybe // do math function $nper = $num_per; $nper2 = ($nper*5); // max reading to devide by //answer = // need to add all the answers here while($i_per1$num_per){ $cper = $cper; $cper1 = @mysql_result($result_per,$i_per1,ques_ans); $i_per1++; $cper2 = @mysql_result($result_per,$i_per1,ques_ans); $cper = ($cper+$cper1+$cper2); // $cper3 = $cper; // this is just an easy extraction // i think this actualy might work echo sub=$sub_id = $cperp; $i_per1++;}; // this should loop through output to count the results total //TEST //echo cper3 = $cper3; $i_per++; }; $i_sub++;}; i know theres some redundant code in there etc.. but hey.. till it works i dont like to delete -- Original Message -- From: Justin Farnsworth [EMAIL PROTECTED] Date: Tue, 25 Dec 2001 09:28:53 -0500 I think you need to post the code. The description of the problem is a bit ambiguous. _justin Webmaster wrote: Hello.. of all days i have a project thats to be shown tomorrow. i cannot get the dam thing to work it should be simple i'd think i would post code and all and if asked will but it comes down to this.. i am using php 4 and mysql.. and doing math i have say 40 entries in the database, 20 for two differant surveys.. anytime anew person fills out the survey they get a unique id i have it set to grabe the results from each unigue id for each question through mysql.. but it seems to
Re: Need Help bad!.. today.. of all days!
Hello.. of all days i have a project thats to be shown tomorrow. i cannot get the dam thing to work it should be simple i'd think i would post code and all and if asked will [snip] Is the performance of your code data independent? That is to say, if you remove (from the database) the set of data where it currently stops, does it stop there again? Does the code stop in the same place with different data? Brad - 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: need help with mysql rpms
try just upgrading the RPMs using rpm -ivh -- Kelly Firkins [EMAIL PROTECTED] I need to remove a previous version of mysql and install the newest. When trying to remove the previous version it complains about dependencies . I don't know what to do about it, so I end up with a successful install of the new version. Any help would be appreciated rpm -e mysql-3.23.36-1 error: removing these packages would break dependencies: mysql = 3.23.36 is needed by mysql-devel-3.23.36-1 mysql = 3.23.36 is needed by mysql-server-3.23.36-1 mysql is needed by php-mysql-4.0.4pl1-9 libmysqlclient.so.10 is needed by mysql-server-3.23.36-1 libmysqlclient.so.10 is needed by perl-DBD-MySQL-1.2215-1 libmysqlclient.so.10 is needed by php-mysql-4.0.4pl1-9 libmysqlclient.so.10 is needed by rpm2html-1.5-4 Raymond _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - 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: need help with mysql rpms
This is what I get rpm -ivh 3.23.46-1.i386.rpm error: failed dependencies: MySQL conflicts with mysql-3.23.36-1 MySQL-server conflicts with mysql-server-3.23.36-1 - Original Message - From: Kelly Firkins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 10, 2001 4:20 PM Subject: Re: need help with mysql rpms try just upgrading the RPMs using rpm -ivh -- Kelly Firkins [EMAIL PROTECTED] I need to remove a previous version of mysql and install the newest. When trying to remove the previous version it complains about dependencies . I don't know what to do about it, so I end up with a successful install of the new version. Any help would be appreciated rpm -e mysql-3.23.36-1 error: removing these packages would break dependencies: mysql = 3.23.36 is needed by mysql-devel-3.23.36-1 mysql = 3.23.36 is needed by mysql-server-3.23.36-1 mysql is needed by php-mysql-4.0.4pl1-9 libmysqlclient.so.10 is needed by mysql-server-3.23.36-1 libmysqlclient.so.10 is needed by perl-DBD-MySQL-1.2215-1 libmysqlclient.so.10 is needed by php-mysql-4.0.4pl1-9 libmysqlclient.so.10 is needed by rpm2html-1.5-4 Raymond _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - 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
Re: need help with mysql rpms
I don't have a Linux box around, so I'll have to check the specific order you can do it... in the meantime, have you tried rpm -ivh *.rpm from that directory? Kelly -- Kelly Firkins [EMAIL PROTECTED] This is what I get rpm -ivh 3.23.46-1.i386.rpm error: failed dependencies: MySQL conflicts with mysql-3.23.36-1 MySQL-server conflicts with mysql-server-3.23.36-1 - Original Message - From: Kelly Firkins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 10, 2001 4:20 PM Subject: Re: need help with mysql rpms try just upgrading the RPMs using rpm -ivh -- Kelly Firkins [EMAIL PROTECTED] I need to remove a previous version of mysql and install the newest. When trying to remove the previous version it complains about dependencies . I don't know what to do about it, so I end up with a successful install of the new version. Any help would be appreciated rpm -e mysql-3.23.36-1 error: removing these packages would break dependencies: mysql = 3.23.36 is needed by mysql-devel-3.23.36-1 mysql = 3.23.36 is needed by mysql-server-3.23.36-1 mysql is needed by php-mysql-4.0.4pl1-9 libmysqlclient.so.10 is needed by mysql-server-3.23.36-1 libmysqlclient.so.10 is needed by perl-DBD-MySQL-1.2215-1 libmysqlclient.so.10 is needed by php-mysql-4.0.4pl1-9 libmysqlclient.so.10 is needed by rpm2html-1.5-4 Raymond _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - 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 _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - 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: need help with mysql rpms
Raymond Norton wrote: error: failed dependencies: MySQL conflicts with mysql-3.23.36-1 MySQL-server conflicts with mysql-server-3.23.36-1 Yeah, the MySQL rpms are incompatible with the mysql rpms (which are done by RedHat). Apparently the two camps each think the other's file system layout and package organization is weird :-). My last question on the topic never brought out a response from anyone concerned.. Unfortunately, the solution isn't as simple as just delete mysql* and install MySQL*, because RedHat has other packages that depend on the mysql RPMs, so you have to nuke those, too, and there aren't any replacement packages for those at the MySQL site. The best solutions for you, if you don't feel like dealing with the problems, are: 1. Go ahead and delete the rest of the dependent packages of mysql (like php-mysql-4.0.4pl1-9), and rebuild those from source if you need them, OR 1a. Remove just the mysql-* packages, but use the --nodeps option to disable the dependency checks for the other packages that depend on mysql. OR 2. Upgrade using the latest RedHat-build RPMs (the latest one I could find is the one with the RH 7.2 distribution, which is 3.23.41. Depending on how recent your libc, etc., are, this may well work with your distribution.. -- Shankar. - 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: Need help with SELECT and JOIN pls
I'm no expert in this in fact I just recently started playing with joins, but here's one that I actually used for a recent shopprt cart piece. I appologise if it wraps but the output is long...content conatins the basic content info but product contains the list of prices. Yes I could have just as easily put the price in the content tbl, but I wanted the admin to pull the predefined prices from one source and make a selectable option rather than a type in value. I also figured from a maintenance standpoint when the price goes up it's one change etc... Ok so in any even I joined the two tbls on c.product_id and p.id. If I read you question correctly you should be able to perform smething similar on eventlog.id and crossref.id... mysql select c.*, p.cost from content as c, product as p where c.product_id = p.id ; ++-+-+---+--++-+--+ | id | filename| thumbnail | sdescr| ldescr | product_id | publish | cost | ++-+-+---+--++-+--+ | 3 | sample.mov | OCSLogo.png | Silly Apple Comercial | came with the streaming server. | 1 | y | 5.95 | | 1 | sample2.mov | OCSLogo.png | Silly Apple Comercial | came with the streaming server. | 2 | y | 2.95 | | 2 | sample.mov | OCSLogo.png | Silly Apple Comercial | came with the streaming server. | 2 | y | 2.95 | ++-+-+---+--++-+--+ 3 rows in set (0.00 sec) I hope this helps... cheers, Mikel Jaime Teng wrote: Hi, I have two tables: mysql describe eventlog; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | id | int(10) unsigned | | PRI | NULL| auto_increment | | timestamp | int(10) unsigned | | MUL | 0 || | description | char(100)| | MUL | || +-+--+--+-+-++ mysql describe crossref; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | word| char(20) | | MUL | || | id | int(10) unsigned | | MUL | || +-+--+--+-+-++ Table 'eventlog' is a table of sentence and a unique 'id'. Table crossref is simply a table of single words and an index 'id'. an entry contains a word and an id where said word can be found on the table 'eventlog'. It is common that a: SELECT * from crossref where word = 'HELLO'; would have multiple results. My question here is I would like to do a search wherein I would like to know which sentence contains the words 'HELLO' and 'DAY' and 'WORLD'. take note that the sentence SHOULD contain ALL the three words not just one or two. I think this is a 'JOIN' question but I am not familiar how to use JOIN. can you show me the syntax? thanks for your help. Jaime - 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
RE: need help
Hi,All: I need your help, When I compile the Msql-Mysql-Modules, I got errors, I am running Redhat7.1 with perl5.6.1, the whole process is just as follows: [root@wappy local]# cd Msql-Mysql-modules-1.2218 [root@wappy Msql-Mysql-modules-1.2218]# perl Makefile.PL Which drivers do you want to install? 1) MySQL only 2) mSQL only (either of mSQL 1 or mSQL 2) 3) MySQL and mSQL (either of mSQL 1 or mSQL 2) 4) mSQL 1 and mSQL 2 5) MySQL, mSQL 1 and mSQL 2 Enter the appropriate number: [3] 1 Do you want to install the MysqlPerl emulation? You might keep your old Mysql module (to be distinguished from DBD::mysql!) if you are concerned about compatibility to existing applications! [n] Where is your MySQL installed? Please tell me the directory that contains the subdir 'include'. [/usr] Which database should I use for testing the MySQL drivers? [test] On which host is database test running (hostname, ip address or host:port) [localhost] User name for connecting to database test? [undef] Password for connecting to database test? [undef] Creating files for MySQL Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lgz Using DBI 1.18 installed in /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DBI Writing Makefile for DBD::mysql Writing Makefile for Msql-Mysql-modules [root@wappy Msql-Mysql-modules-1.2218]# make /usr/local/bin/pod2text mysql/lib/DBD/mysql.pm README make[1]: Entering directory `/usr/local/Msql-Mysql-modules-1.2218/mysql' cp lib/DBD/mysql.pm ../blib/lib/DBD/mysql.pm cp lib/Bundle/DBD/mysql.pm ../blib/lib/Bundle/DBD/mysql.pm cp lib/Mysql/Statement.pm ../blib/lib/Mysql/Statement.pm cp lib/Mysql.pm ../blib/lib/Mysql.pm cc -c -I/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DBI -I/usr/incl ude/mysql -I../dbd -I/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DB I -I/usr/local/lib/perl5/5.6.1/i686-linux -fno-strict-aliasing -D_LARGEFILE_ SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\2.0418\ -DXS_VERSION=\2.04 18\ -fpic -I/usr/local/lib/perl5/5.6.1/i686-linux/CORE -DDBD_MYSQL dbdimp.c dbdimp.c: In function `MysqlReconnect': dbdimp.c:2157: warning: assignment from incompatible pointer type /usr/local/bin/perl -p -e s/~DRIVER~/mysql/g /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DBI/Driver.xst mysql.xsi /usr/local/bin/perl -I/usr/local/lib/perl5/5.6.1/i686-linux -I/usr/local/lib /perl5/5.6.1 /usr/local/lib/perl5/5.6.1/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.6.1/ExtUtils/typemap mysql.xs mysql.xsc mv mysql.xsc mysql.c Warning: duplicate function definition 'rows' detected in mysql.xs, line 407 cc -c -I/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DBI -I/usr/incl ude/mysql -I../dbd -I/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/auto/DB I -I/usr/local/lib/perl5/5.6.1/i686-linux -fno-strict-aliasing -D_LARGEFILE_ SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\2.0418\ -DXS_VERSION=\2.04 18\ -fpic -I/usr/local/lib/perl5/5.6.1/i686-linux/CORE -DDBD_MYSQL mysql.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f ../blib/arch/auto/DBD/mysql/mysql.so LD_RUN_PATH=/usr/lib/mysql:/lib:/usr/lib:/usr/lib/gcc-lib/i386-redhat-linux /2.96 cc -shared -L/usr/local/lib dbdimp.o mysql.o -L/usr/lib/mysql -o ../blib/arch/auto/DBD/mysql/mysql.so -L/usr/lib/mysql -lmysqlclient -lm -l z -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 -lgcc /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status make[1]: *** [../blib/arch/auto/DBD/mysql/mysql.so] Error 1 make[1]: Leaving directory `/usr/local/Msql-Mysql-modules-1.2218/mysql' make: *** [subdirs] Error 2 [root@wappy Msql-Mysql-modules-1.2218]# Could somebody tell me what's wrong. Thanks a lot. David Niu Dec.5th - 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: Need help with SELECT 2 tables from choice of 3
OldMembers Memebers Data Why no have 3 tables: Members Data TheseMembersAreOld Members and Data are as you have them defined. TheseMembersAreOld contains only the Member_ID field. You then make the Member_ID field primary key on TheseMembersAreOld and Members. You can then perform a very fast joins. Thomas, Denmark - 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: Need help with SELECT 2 tables from choice of 3
Why no have 3 tables: Members Data TheseMembersAreOld Members and Data are as you have them defined. TheseMembersAreOld contains only the Member_ID field. You then make the Member_ID field primary key on TheseMembersAreOld and Members. You can then perform a very fast joins. Hm, thank you for the idea... I think my problem is the OLD members and members are not the same people. That is why I have renamed them (added 10 number to every one of them), so Data table now has numbers from 1-1000 (my new members) numbers from 10 to 101000 (my old members). From old members I only need the name, nothing else! From new members I need all the data. Now because in the forum topic (yes, I am builing a custom forum) there must be a member, I need 1. If this is an old member from the old forum to disply only name 2. If member is new to display all the data. Now I have a problem of joining the 3 tables because obviously in Data field Member_ID there is a number that represents a member OR a number that represents a old member, never both (none is the same). In SQL I can not do the AND and compare both MEMBER_ID's because it would never return anything. If I use or I do get data, but not one, but multiplied number od times (every new member is then resulted or every old member, depending on in which table SQL finds the data). Yours Jerry Slovenia - 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: Need help migrating MSSQL to MySQL...
Hi. On Tue, Nov 06, 2001 at 12:34:26AM -0700, [EMAIL PROTECTED] wrote: In MSSQL I can aggregate various fields like the [totalRev] field listed below: Does anyone know if or how to do this in MySQL? You can't. You only can do this in the SELECT clause or make a column that your application keeps current on INSERT/UPDATE. Bye, Benjamin. CREATE TABLE [dbo].[Financials] ( [...] [revM11] [float] NULL , [revM12] [float] NULL , [totalRev] AS ([revM1] + [revM2] + [revM3] + [revM4] + [revM5] + [revM6] + [revM7] + [revM8] + [revM9] + [revM10] + [revM11] + [revM12]) ON [PRIMARY] [...] -- [EMAIL PROTECTED] - 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: Need help with mysqldump
Hi, I'm running MySQL ver 3.23.38 on Win98 platform and am trying to learn to do backups. I'm trying the mysqldump command but I'm getting the error: Access denied for user '@localhost' How do I specify a user for mysqldump? mysqldump --user=username ... Try mysqldump --help for more :) Regards, Sasa - 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: Need help with a query ...
Hi John Kelly, This is not a perfect solution but may be useful to you. But still with two queries! From Mysql prompt issue these two queries. SELECT @maxcat := max(Category) FROM table WHERE category = 'Sports:Football:Players' OR category = 'Sports:Football' OR category = 'Sports'; Select * from table where category = @maxcat; Note that abc is greater than ab This will not be affected by the depth of category. Anvar. At 06:15 PM 02/11/2001 -0800, you wrote: Hi, I have a MySQL table with a column that contains some of a web site directory's category names in the format: Sports:Football:Players I am trying to build a query that that locates all records that match the above category name OR if none exist its parent Sports:Football OR if none exist its parent Sports. The top level category, in this case Sports, will always have at least one matching record. I know I can do this with multiple queries by checking the previous query's result, but I am trying to build a query that does it all in one lookup to avoid lots of lookups in deep categories. Something along the logical lines of ... SELECT * FROM table WHERE category = 'Sports:Football:Players' OR IF NONE category = 'Sports:Football' OR IF NONE category = 'Sports' ... of course the above query does not work but if anyone knows of how to accomplish something similar in one query I would much appreciate it. Thanks! - 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
Re: Need help with a query ...
You need to use the LIKE command I think. The MySQL manual should give you all the details. If you need further help I can just write the whole query out for you. Or was the problem that you only want to worry about the if..then stuff if needed? If so could you tell what your pulling back from that table? The principal mark of genius is not perfection but originality, the opening of new frontiers. -- Arthur Koestler *^*^*^* Michael McGlothlin [EMAIL PROTECTED] http://mlug.missouri.edu/~mogmios/projects/ On Fri, 2 Nov 2001, John Kelly wrote: Hi, I have a MySQL table with a column that contains some of a web site directory's category names in the format: Sports:Football:Players I am trying to build a query that that locates all records that match the above category name OR if none exist its parent Sports:Football OR if none exist its parent Sports. The top level category, in this case Sports, will always have at least one matching record. I know I can do this with multiple queries by checking the previous query's result, but I am trying to build a query that does it all in one lookup to avoid lots of lookups in deep categories. Something along the logical lines of ... SELECT * FROM table WHERE category = 'Sports:Football:Players' OR IF NONE category = 'Sports:Football' OR IF NONE category = 'Sports' ... of course the above query does not work but if anyone knows of how to accomplish something similar in one query I would much appreciate it. Thanks! - 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
Re: Need help with a query ...
Hi, thanks for your response. I don't see how the LIKE command would help me pull records that matched the category name or its parent category if none exist, or its parent category if none exists. Perhaps you could provide a example. I want something that follows this logic ... SELECT * FROM table WHERE category = 'Sports:Football:Players' OR IF NONE category = 'Sports:Football' OR IF NONE category = 'Sports' Regarding the purpose of this query, it will be performed in every page/category in a web site directory looking to see if an advertisement is available for the current category, if not, it needs to look for one assigned to the parent category, so on and so on until it reaches the top level category for which there will always be an ad. Any suggestions/examples appreciated! John - Original Message - From: Michael [EMAIL PROTECTED] To: John Kelly [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, November 02, 2001 7:09 PM Subject: Re: Need help with a query ... You need to use the LIKE command I think. The MySQL manual should give you all the details. If you need further help I can just write the whole query out for you. Or was the problem that you only want to worry about the if..then stuff if needed? If so could you tell what your pulling back from that table? The principal mark of genius is not perfection but originality, the opening of new frontiers. -- Arthur Koestler *^*^*^* Michael McGlothlin [EMAIL PROTECTED] http://mlug.missouri.edu/~mogmios/projects/ On Fri, 2 Nov 2001, John Kelly wrote: Hi, I have a MySQL table with a column that contains some of a web site directory's category names in the format: Sports:Football:Players I am trying to build a query that that locates all records that match the above category name OR if none exist its parent Sports:Football OR if none exist its parent Sports. The top level category, in this case Sports, will always have at least one matching record. I know I can do this with multiple queries by checking the previous query's result, but I am trying to build a query that does it all in one lookup to avoid lots of lookups in deep categories. Something along the logical lines of ... SELECT * FROM table WHERE category = 'Sports:Football:Players' OR IF NONE category = 'Sports:Football' OR IF NONE category = 'Sports' ... of course the above query does not work but if anyone knows of how to accomplish something similar in one query I would much appreciate it. Thanks! - 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
Re: Need help with a query ...
On Fri, Nov 02, 2001 at 06:15:08PM -0800, John Kelly wrote: Hi, I have a MySQL table with a column that contains some of a web site directory's category names in the format: Sports:Football:Players I am trying to build a query that that locates all records that match the above category name OR if none exist its parent Sports:Football OR if none exist its parent Sports. The top level category, in this case Sports, will always have at least one matching record. I know I can do this with multiple queries by checking the previous query's result, but I am trying to build a query that does it all in one lookup to avoid lots of lookups in deep categories. Something along the logical lines of ... SELECT * FROM table WHERE category = 'Sports:Football:Players' OR IF NONE category = 'Sports:Football' OR IF NONE category = 'Sports' ... of course the above query does not work but if anyone knows of how to accomplish something similar in one query I would much appreciate it. Sir, the problem is that relational databases use set logic, and you are trying to find a solution in sequential logic. You need three tables. I'll call them Cat1, Cat2, and Cat3, but you should rename them to whatever makes sense to you. They will hold, respectively, 'Sports', 'Football', and 'Players'. (Or 'Business', 'Industry', and 'Firms'. Or whatever.) The table structure would be something like: Cat1(Cat1ID, Category) Cat2(Cat1ID, Cat2ID, Category) Cat3(Cat2ID, Cat3ID, Category) A sample row in Cat1 would be (1, 'Sports') A sample row in Cat2 would be (1, 1, 'Football') A sample row in Cat3 would be (1, 1, 'Players') (If you're not concerned about economizing on storage, you could eliminate the IDs and have each child record refer to the parent category instead of the parent ID. In that case, you don't need the Cat1 table, which serves only to match a category with its ID.) The query would be SELECT Cat1.Category, Cat2.Category, Cat3.Category FROM (Cat1 LEFT JOIN Cat2 ON Cat1.Cat1ID = Cat2.Cat1ID) LEFT JOIN Cat3 ON Cat2.Cat2ID = Cat3.Cat2ID WHERE Cat1.Category = 'Sports' AND (Cat2.Category = 'Football' OR Cat2.Category IS NULL) AND (Cat3.Category = 'Players' OR Cat3.Category IS NULL); If you want the output in the 'Sports:Football:Players' form, you can rewrite the SELECT clause as SELECT Concat(Cat1.Category, If(IsNull(Cat2.Category), '', ':'), Cat2.Category, If(IsNull(Cat3.Category), '', ':'), Cat3.Category) Disclaimer: I haven't run this, so I might have gotten some of the details wrong. Bob Hall - 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: need help setting up and rinning mysql server
jesse junsay writes: Then this error occurs. starting mysqld daemon with databases from XX mysql daemon ended The manual didn't say anything on how to solve this problem. So I hope this will help. That's not an error message. Error messages can be found in the error log, which the manual discusses here: http://www.mysql.com/doc/E/r/Error_log.html -- Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/ Amiga user since '89, and damned proud of it too. - 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: need help setting up and rinning mysql server
Unless you ran it as mysql_install_db --user=mysql mysql does not own the databases. do chown -R mysql /usr/local/mysql chown -R /var/lib/mysql ( Or whereever your database directory is ) jesse junsay wrote: Hi.. I have a problem running my MySQL server. After running shellmysql_install_db when everything runs fine then I tried to start the server with this command shellsafe_mysqld Then this error occurs. starting mysqld daemon with databases from XX mysql daemon ended The manual didn't say anything on how to solve this problem. So I hope this will help. Please send your response to [EMAIL PROTECTED] thanks... __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 - 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 -- Gerald L. Clark [EMAIL PROTECTED] - 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: need help to uninstall mysql
I had a similar problem on a win2k system when I started using mySQL. I changed the user and password in phpmyadmin's config.inc.php. Or you can change it in the my.ini file. This might be alot more complicated with a unix system. - Original Message - From: GUYOT Carole [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 18, 2001 15:21 Subject: need help to uninstall mysql I've changed root's password via netscape with phpmyadmin and then reloaded. It's not possible to connect anymore. The system asked for a new password but didn't accept the new one. So, I've tryed to re-install mysql again version : MySQL-3.23.38-1.i386.rpm on redhat Linux. Now, when I try to connect, I have ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) Things are getting worse and worse! How can I completely uninstall and get clean all files linked to mysql? Need urgent help please ! NTMail K12 - the Mail Server for Education - 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 *** This message may contain information which is confidential and subject to legal privilege. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and return and/or destroy the original message. *** - 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: need help to uninstall mysql
First, there is no need to reinstall. For future reference, if you forget your password - check the manual for an easy way to fix: http://www.mysql.com/doc/R/e/Resetting_permissions.html For a mysql that wont start, check the error log and isolate what the problem is ( it probably isnt that hard to fix ). The log is probably /var/lib/mysql/hostname.err , but Im not familiar with redhat so that is just a guess. dpk - Original Message - From: GUYOT Carole [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 18, 2001 6:21 AM Subject: need help to uninstall mysql I've changed root's password via netscape with phpmyadmin and then reloaded. It's not possible to connect anymore. The system asked for a new password but didn't accept the new one. So, I've tryed to re-install mysql again version : MySQL-3.23.38-1.i386.rpm on redhat Linux. Now, when I try to connect, I have ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) Things are getting worse and worse! How can I completely uninstall and get clean all files linked to mysql? Need urgent help please ! NTMail K12 - the Mail Server for Education - 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
Re: need help with select statements
On Thursday 30 August 2001 15:28, Andre Konopka wrote: Hi, I have, three tables (one,two, three) with the rows id/value. id is the key for all the tables. with select value from one where id=xx; select value from two where id=xx; select value from three where id=xx; I can select all values from the tables with the id=xx. How can I do this with one select statement. Notice, it's possible that there is an entry for id=xx in table one, but not in table two, or three. Of course ist's possible that there is only a value in table three. The output could be id one.value two.value three.value x1 233 2342 NULL x2 NULL 998NULL x3 33 232 23 Clear enough? A couple of LEFT JOINs should probably do the trick HTH Ian Barwick -- Ian Barwick - Developer - [EMAIL PROTECTED] akademie.de asp GmbH - http://www.akademie.de To query tables in a MySQL database is more fun than eating spam - 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: Need Help Setting Up MySQL on Win98
Date |Mon, 27 Aug 2001 12:54:25 -0700 (PDT) From |S K Bryan [EMAIL PROTECTED] Hello! SKB Hello - SKB I'm very new at this, so please pardon the very beginner questions... SKB I'm attemtping to install MySQL to my local machine running Win98. The SKB install seems to go alright, but when I try mysqld--standalone it SKB gives me an error. Then I tried mysqld -standalone, which seemed to SKB work. SKB Then I entered, mysqladmin create testDB and I got the error message SKB Can't connect to MySQL Server on 'localhost'. I tried telnetting to SKB telnet localhost 3306 and got an error that it couldn't connect. SKB Can anyone offer help? You need to use just c:\mysql\bin\mysqld command to start mysqld Also note that you need to have winsock 2 installed on your Win. http://www.mysql.com/doc/W/i/Win95_start.html ___ For technical support contracts, visit https://order.mysql.com/ This email is sponsored by SWSoft, http://www.asplinux.ru/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Grigory Bakunov [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB / SWSoft /_/ /_/\_, /___/\___\_\___/ ___/ www.mysql.com - 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: Need Help Setting Up MySQL on Win98
At 12:54 PM 8/27/01 -0700, you wrote: Hello - I'm very new at this, so please pardon the very beginner questions... I'm attemtping to install MySQL to my local machine running Win98. The install seems to go alright, but when I try mysqld--standalone it gives me an error. Then I tried mysqld -standalone, which seemed to work. Then I entered, mysqladmin create testDB and I got the error message Can't connect to MySQL Server on 'localhost'. I tried telnetting to telnet localhost 3306 and got an error that it couldn't connect. Can anyone offer help? Yeah, try double clicking on the winmysqladmin.exe icon. - 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: Need Help Setting Up MySQL on Win98
Try putting a space between mysqld and --standalone (mysqld --standalone) - Original Message - From: S K Bryan [EMAIL PROTECTED] To: MySQL [EMAIL PROTECTED] Sent: Monday, August 27, 2001 2:54 PM Subject: Need Help Setting Up MySQL on Win98 Hello - I'm very new at this, so please pardon the very beginner questions... I'm attemtping to install MySQL to my local machine running Win98. The install seems to go alright, but when I try mysqld--standalone it gives me an error. Then I tried mysqld -standalone, which seemed to work. Then I entered, mysqladmin create testDB and I got the error message Can't connect to MySQL Server on 'localhost'. I tried telnetting to telnet localhost 3306 and got an error that it couldn't connect. Can anyone offer help? Thanks - Shawn [EMAIL PROTECTED] __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ - 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
RE: need help
Hi !! )-Original Message- )From: qball cow [mailto:[EMAIL PROTECTED]] )Sent: Sunday, August 19, 2001 10:50 AM )To: [EMAIL PROTECTED] )Subject: Fw: need help ) ) )I have made a mysql server on my linux box. and via Myobdc I )access it from a C++ programm I made.. I can see the records.. but )If I change one.. I get the error: ) )No Cursor name availible ) )I dont know whats wrong.. so I hope anybody can help me. ) Did you tried with the latest .38 MyODBC driver ? Also, the error message says you are trying to do some cursor operation, without setting the cursor name through SQLSetCursorName prior to the execution. Is it possible for you to send the ODBC trace, so that we can guess what exactly is going wrong ? Thanks in advance Venu -- For technical support contracts, go to https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Venu [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer /_/ /_/\_, /___/\___\_\___/ Woodside, California USA ___/ www.mysql.com - 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: Need help with mysql
Malkhaz Mangoshvili [EMAIL PROTECTED] writes: Hello. I installed on my computer Red Hat Linux 7.0. After that I started configuring mysql. I upgraded mysql, added all necessary packages and I wanted to run mysql server. Whenever I type mysql it gives me such an error message: ERROR 2002: Can't connect to MYSQL server through socket /var/lib/mysql/mysql.sock . I found out from the internet that I needed to change permission for the mysql.socket by typing chmod 777 mysql.socket. For the first time this file didn't even exist, then it was created when I typed mysql_install_db, but it is empty. Version of this mysql is: 3.23.22-beta. 1) Remove /var/lib/mysql (shouldn't be necesarry, but just to be safe 2) Get the updated rpms (you can get them with up2date). The version of these are mysql-3.23.32-1.7 3) Start mysql with service mysqld start - don't do safe_mysqld, mysql_install_db: The database is initialized automatically the first time it's run -- Trond Eivind Glomsrød Red Hat, Inc. - 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: Need help with mysql
At 6:23 PM -0400 6/16/01, Malkhaz Mangoshvili wrote: Hello. I installed on my computer Red Hat Linux 7.0. After that I started configuring mysql. I upgraded mysql, added all necessary packages and I wanted to run mysql server. Are you using RedHat's MySQL RPMs? If so, you should uninstall them and start over with the RPMs from the MySQL site. Whenever I type mysql it gives me such an error message: ERROR 2002: Can't connect to MYSQL server through socket /var/lib/mysql/mysql.sock . I found out from the internet that I needed to change permission for the mysql.socket by typing chmod 777 mysql.socket. For the first time this file didn't even exist, then it was created when I typed mysql_install_db, but it is empty. Version of this mysql is: 3.23.22-beta. I am very sorry about that, but I really need to get mysql running from the Linux platform, in order to use it in my C/C++ programs. Please if anybody could help me I would appreciate that. I'll wait for the answer. Thank you. Mike -- Paul DuBois, [EMAIL PROTECTED] - 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: Need help on mysql/php
On Wed, 6 Jun 2001, Ian Ford wrote: Name your config file config.inc and if any of the below situations happen your password and username will not show up in plain text for the casual browser. (EXAMPLE: CONFIG.INC ? $DBname = 'test'; $DBuser = 'imatest'; $DBpass = 'Whatever'; $DBhost = 'localhost'; ? INDEX.PHP ? require(config.inc); $conn = mysql_connect($DBhost,$DBuser,$DBpass); mysql_select_db($DBname); ? END EXAMPLE) You can place the config.inc any where you want. My preference is in a includes folder... Actually I tried this out sometime ago and found that it appears as a plain text file. This I believe is because the webserver know that .php or .php3 should be treated as a php file and other in which ever way it can display. -Original Message- From: Neil Zanella [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 12:09 PM To: Don Read Cc: Ed Peddycoart; Mysql@Lists. Mysql. Com; Jorge Oliveira Subject: RE: Need help on mysql/php On Tue, 5 Jun 2001, Don Read wrote: Better yet, put the file outside the $DOCUMENT_ROOT, in case your server is poorly configured. include($DOCUMENT_ROOT/../config.php); This is a very good idea. One day if the system administrator decides to back up all the user data and upgrade the web server and forgets to include support for PHP then all the PHP files become readable as plain text and casual web surfers could sniff your password. Another scenario where this could happen is if there are two web servers and your home directory is mounted on both via NFS or AFS and you may not be aware that the other web server does not have PHP support. If you are serving from /home/httpd/html then store your database access information including passwords in some directory like /home/httpd/secret and set the right ownerships for that directory and files therein. It is also a good idea to control extraneous access to the database by firewalling your site. Neil - 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
RE: Need help on mysql/php
At 2:13 PM +0530 6/7/01, Adrian D'Costa wrote: On Wed, 6 Jun 2001, Ian Ford wrote: Name your config file config.inc and if any of the below situations happen your password and username will not show up in plain text for the casual browser. (EXAMPLE: CONFIG.INC ? $DBname = 'test'; $DBuser = 'imatest'; $DBpass = 'Whatever'; $DBhost = 'localhost'; ? INDEX.PHP ? require(config.inc); $conn = mysql_connect($DBhost,$DBuser,$DBpass); mysql_select_db($DBname); ? END EXAMPLE) You can place the config.inc any where you want. My preference is in a includes folder... Actually I tried this out sometime ago and found that it appears as a plain text file. This I believe is because the webserver know that .php or .php3 should be treated as a php file and other in which ever way it can display. That only applies to the extension of the top-level file. Included files can have any extension. You do, however, have to surround the text of the included file with ?php ? or ? ? or whatever tags you use. That might have been your problem. -- Paul DuBois, [EMAIL PROTECTED] - 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: Need help on mysql/php
split code for use username and password to connect to MySQL into other file and use include in every php program instead have username and password code. connect.inc.php ? // define database connect variable $hostname = localhost; $username = root; $password = password; $tblname = yourtablename; $dbName = yourdbname; MYSQL_CONNECT($hostname, $username, $password) OR DIE(Unable to connect to database); @mysql_select_db($dbName) or die(Unable to select database); print Succesful connect...; ? readfile.php ? include (connect.inc.php); ... other php code ... ? Regards, Sommai Fongnamthip At 22:37 5/6/2001 +0100, Jorge Oliveira wrote: Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Quarta-feira, 6 de Junho de 2001 0:29 Para: Jorge Oliveira; Mysql@Lists. Mysql. Com Assunto: RE: Need help on mysql/php Thanks...this helped...Just had success in connecting to the MySQL server and dumping the db contents to the screenOne worrisome bit though...My username and password for connecting to the db on my host is my username and password for the web account. If I want to create dynamic webpages by pulling data from my db, won't I have to put this information (usersname and pw) in the php file and leave it on the server? Sounds pretty darn scary to me...maybe I am confused. Ed -Original Message- From: Jorge Oliveira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 12:47 PM To: Mysql@Lists. Mysql. Com Subject: RE: Need help on mysql/php Hi, Please refer to http://www.php.net/manual/en/ref.mysql.php Jorge Oliveira [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Terça-feira, 5 de Junho de 2001 21:31 Para: [EMAIL PROTECTED] Assunto: Need help on mysql/php I recently move my website to FastWebServers.com. MySQL and PHP is provided. I have a control panel which allows me to initialize MySQL for my use. The initialization creates a db, named celticblues_com (my domain is celticblues.com). So far, I have added a table to my database, and added the neccessary fields. Now I am at a total loss at what to do. I want to use PHP scripts to pull info from the db and search the db etc. I have contacted my support from FWS, but they point me to MySQL.com for Mysql commands technical support. Seems to me I would need to know how to set username/password to access the db from script etc. The bottom line question is can someone point me to information on what I need to do to be able to access(open/close) the db, retrieve/store information, etc. in this type of environment (i.e. MySQL provide by my host service, not installed by me)? Ed - 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 - 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
Re: need help for a simple request
alexandre Roussel wrote: Hi, I have some problems with the following SQL request that I process with phpMyAdmin : select * from TABLE2 where FIELD not in (select FIELD from TABLE1); This request identify all records in TABLE2 which are not in TABLE1 (depending on value of FIELD). TABLE1 and TABLE2 have exactly the same sturcture. I currently use MySql 3.22.34 and phpMyAdmin 2.1.0 What's wrong ? You cannot use subqueries in MySQL. Try something like this: select table2.field from table2 left join table1 on (table2.field=table1.field) where table1.field is null; -- _/_/ _/_/_/ - Rafa Jank [EMAIL PROTECTED] - _/ _/ _/ _/ _/ Wirtualna Polska SA http://www.wp.pl _/_/_/_/ _/_/_/ul. Uphagena 2, 80-237 Gdansk, tel/fax. (58) 5215625 _/ _/ _/ ==* http://szukaj.wp.pl *==-- - 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: need help for a simple request
On Wed, 6 Jun 2001 11:52:14 +0200, alexandre Roussel [EMAIL PROTECTED] wrote: subselects are not currently supported with MySQL. Hi, I have some problems with the following SQL request that I process with phpMyAdmin : select * from TABLE2 where FIELD not in (select FIELD from TABLE1); This request identify all records in TABLE2 which are not in TABLE1 (depending on value of FIELD). TABLE1 and TABLE2 have exactly the same sturcture. I currently use MySql 3.22.34 and phpMyAdmin 2.1.0 What's wrong ? Thank you for your help. - 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 Mike(mickalo)Blezien Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225) 686-2002 = - 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: Need help on mysql/php
At 7:49 AM -0700 6/6/01, Ed Peddycoart wrote: It is a shared server Ed Then you're vulnerable, unless the ISP can demonstrate otherwise. -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 6:02 PM To: Jorge Oliveira; Ed Peddycoart Cc: Mysql@Lists. Mysql. Com Subject: RE: Need help on mysql/php At 10:37 PM +0100 6/5/01, Jorge Oliveira wrote: Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! Actually, anyone else on the Web server host that has permission to install scripts for the Web server can access the source. I couldn't tell from the original message whether the Web server is shared with other people or not, but if you don't have your own server, you're exposed. I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -- Paul DuBois, [EMAIL PROTECTED] -- Paul DuBois, [EMAIL PROTECTED] - 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: Need help on mysql/php
Actually you are only exposed if you have not set up Apache to run with virtual hosts. It is not difficult to configure Apache so that a person can only see the scripts that are in his/her directory, and is prevented from seeing or modifying the scripts in other peoples directories. Also, it is wise to place your DB passwords in a separate small file, and then include the file in all your scripts. You can place the password file in a directory that doesn't have any accessibility from anyone on the web. Let's say we have a password file called dbpass.inc, and we place it in a directory called /var/protected off the root. Only the webserver is set to have permission to access this directory. The password file should look something like this: ?php username=username; password=password; ? Then in all your scripts include the following line: include ('/var/protected/dbpass.inc); -Ken At 08:02 PM 6/5/01 -0500, Paul DuBois wrote: At 10:37 PM +0100 6/5/01, Jorge Oliveira wrote: Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! Actually, anyone else on the Web server host that has permission to install scripts for the Web server can access the source. I couldn't tell from the original message whether the Web server is shared with other people or not, but if you don't have your own server, you're exposed. I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -- Paul DuBois, [EMAIL PROTECTED] - 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
RE: Need help on mysql/php
On Tue, 5 Jun 2001, Don Read wrote: Better yet, put the file outside the $DOCUMENT_ROOT, in case your server is poorly configured. include($DOCUMENT_ROOT/../config.php); This is a very good idea. One day if the system administrator decides to back up all the user data and upgrade the web server and forgets to include support for PHP then all the PHP files become readable as plain text and casual web surfers could sniff your password. Another scenario where this could happen is if there are two web servers and your home directory is mounted on both via NFS or AFS and you may not be aware that the other web server does not have PHP support. If you are serving from /home/httpd/html then store your database access information including passwords in some directory like /home/httpd/secret and set the right ownerships for that directory and files therein. It is also a good idea to control extraneous access to the database by firewalling your site. Neil - 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: Need help on mysql/php
At 10:35 AM -0700 6/6/01, Kenneth Kopelson wrote: Actually you are only exposed if you have not set up Apache to run with virtual hosts. It is not difficult to configure Apache so that a person can only see the scripts that are in his/her directory, and is prevented from seeing or modifying the scripts in other peoples directories. Also, it is wise to place your DB passwords in a separate small file, and then include the file in all your scripts. You can place the password file in a directory that doesn't have any accessibility from anyone on the web. Let's say we have a password file called dbpass.inc, and we place it in a directory called /var/protected off the root. Only the webserver is set to have permission to access this directory. The password file should look something like this: ?php username=username; password=password; ? Then in all your scripts include the following line: include ('/var/protected/dbpass.inc); Except that all scripts run by Apache run with the same file system access privileges (namely, the privileges of the account under which Apache is set to run). So all scripts run by a given instance of the server have equivalent access privileges. If you and I have scripts run by that server, my scripts can read yours. I don't see that virtual hosts have much to do with it. (Unless you're talking about Apache 2.xx, which will solve this problem by allowing different virtual hosts to be associated with distinct user IDs.) -Ken At 08:02 PM 6/5/01 -0500, Paul DuBois wrote: At 10:37 PM +0100 6/5/01, Jorge Oliveira wrote: Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! Actually, anyone else on the Web server host that has permission to install scripts for the Web server can access the source. I couldn't tell from the original message whether the Web server is shared with other people or not, but if you don't have your own server, you're exposed. I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -- Paul DuBois, [EMAIL PROTECTED] - 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: Need help on mysql/php
Name your config file config.inc and if any of the below situations happen your password and username will not show up in plain text for the casual browser. (EXAMPLE: CONFIG.INC ? $DBname = 'test'; $DBuser = 'imatest'; $DBpass = 'Whatever'; $DBhost = 'localhost'; ? INDEX.PHP ? require(config.inc); $conn = mysql_connect($DBhost,$DBuser,$DBpass); mysql_select_db($DBname); ? END EXAMPLE) You can place the config.inc any where you want. My preference is in a includes folder... Thank you, Ian Ford Northwest Link Web Development -Original Message- From: Neil Zanella [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 12:09 PM To: Don Read Cc: Ed Peddycoart; Mysql@Lists. Mysql. Com; Jorge Oliveira Subject: RE: Need help on mysql/php On Tue, 5 Jun 2001, Don Read wrote: Better yet, put the file outside the $DOCUMENT_ROOT, in case your server is poorly configured. include($DOCUMENT_ROOT/../config.php); This is a very good idea. One day if the system administrator decides to back up all the user data and upgrade the web server and forgets to include support for PHP then all the PHP files become readable as plain text and casual web surfers could sniff your password. Another scenario where this could happen is if there are two web servers and your home directory is mounted on both via NFS or AFS and you may not be aware that the other web server does not have PHP support. If you are serving from /home/httpd/html then store your database access information including passwords in some directory like /home/httpd/secret and set the right ownerships for that directory and files therein. It is also a good idea to control extraneous access to the database by firewalling your site. Neil - 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
RE: Need help on mysql/php
On Wed, 6 Jun 2001, Ian Ford wrote: Name your config file config.inc and if any of the below situations happen your password and username will not show up in plain text for the casual browser. (EXAMPLE: CONFIG.INC ? $DBname = 'test'; $DBuser = 'imatest'; $DBpass = 'Whatever'; $DBhost = 'localhost'; ? INDEX.PHP ? require(config.inc); $conn = mysql_connect($DBhost,$DBuser,$DBpass); mysql_select_db($DBname); ? END EXAMPLE) You can place the config.inc any where you want. My preference is in a includes folder... The config.inc file should still be placed outside of the document root to guard against the security risks I described. If not then there is nothing preventing the user from entering the full URL to config.inc. Neil - 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: Need help on mysql/php
Hi, Please refer to http://www.php.net/manual/en/ref.mysql.php Jorge Oliveira [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Terça-feira, 5 de Junho de 2001 21:31 Para: [EMAIL PROTECTED] Assunto: Need help on mysql/php I recently move my website to FastWebServers.com. MySQL and PHP is provided. I have a control panel which allows me to initialize MySQL for my use. The initialization creates a db, named celticblues_com (my domain is celticblues.com). So far, I have added a table to my database, and added the neccessary fields. Now I am at a total loss at what to do. I want to use PHP scripts to pull info from the db and search the db etc. I have contacted my support from FWS, but they point me to MySQL.com for Mysql commands technical support. Seems to me I would need to know how to set username/password to access the db from script etc. The bottom line question is can someone point me to information on what I need to do to be able to access(open/close) the db, retrieve/store information, etc. in this type of environment (i.e. MySQL provide by my host service, not installed by me)? Ed - 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
Re: Need help on mysql/php
Great support.. Right.. take a look at www.devshed.com they've got a few nice tutorials.. if you plan to work a lot with MySQL you might want to buy the book called MySQL written by Paul DuBois or fill out the survey and hope you'll get one for free ;-).. Other interesting websites: www.phpbuilder.com www.phpnewbie.com www.phpbeginner.com and many others can be found using your favorite searchengine. Bye, B. At 13:30 5-6-01 -0700, Ed Peddycoart wrote: I recently move my website to FastWebServers.com. MySQL and PHP is provided. I have a control panel which allows me to initialize MySQL for my use. The initialization creates a db, named celticblues_com (my domain is celticblues.com). So far, I have added a table to my database, and added the neccessary fields. Now I am at a total loss at what to do. I want to use PHP scripts to pull info from the db and search the db etc. I have contacted my support from FWS, but they point me to MySQL.com for Mysql commands technical support. Seems to me I would need to know how to set username/password to access the db from script etc. The bottom line question is can someone point me to information on what I need to do to be able to access(open/close) the db, retrieve/store information, etc. in this type of environment (i.e. MySQL provide by my host service, not installed by me)? Ed - 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
Re: Need help on mysql/php
Hello Ed, Tuesday, June 05, 2001, 11:30:36 PM, you wrote: EP I recently move my website to FastWebServers.com. MySQL and PHP is EP provided. I have a control panel which allows me to initialize MySQL for my EP use. The initialization creates a db, named celticblues_com (my domain is EP celticblues.com). So far, I have added a table to my database, and added EP the neccessary fields. Now I am at a total loss at what to do. I want to EP use PHP scripts to pull info from the db and search the db etc. I have EP contacted my support from FWS, but they point me to MySQL.com for Mysql EP commands technical support. Seems to me I would need to know how to set EP username/password to access the db from script etc. The bottom line EP question is can someone point me to information on what I need to do to be EP able to access(open/close) the db, retrieve/store information, etc. in this EP type of environment (i.e. MySQL provide by my host service, not installed by EP me)? EP Ed EP - EP Before posting, please check: EPhttp://www.mysql.com/manual.php (the manual) EPhttp://lists.mysql.com/ (the list archive) EP To request this thread, e-mail [EMAIL PROTECTED] EP To unsubscribe, e-mail [EMAIL PROTECTED] EP Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php I don't uderstand exactly what you need... If you don't know how to work with MySQL databases using PHP just look at PHP Manual (http://www.php.net/docs.php) Chapter L. MySQL functions (http://www.php.net/manual/en/ref.mysql.php). To understand it quickly see function mysql_connect. -- Best regards, Olexandrmailto:[EMAIL PROTECTED] - 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: Need help on mysql/php
Thanks...this helped...Just had success in connecting to the MySQL server and dumping the db contents to the screenOne worrisome bit though...My username and password for connecting to the db on my host is my username and password for the web account. If I want to create dynamic webpages by pulling data from my db, won't I have to put this information (usersname and pw) in the php file and leave it on the server? Sounds pretty darn scary to me...maybe I am confused. Ed -Original Message- From: Jorge Oliveira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 12:47 PM To: Mysql@Lists. Mysql. Com Subject: RE: Need help on mysql/php Hi, Please refer to http://www.php.net/manual/en/ref.mysql.php Jorge Oliveira [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Terça-feira, 5 de Junho de 2001 21:31 Para: [EMAIL PROTECTED] Assunto: Need help on mysql/php I recently move my website to FastWebServers.com. MySQL and PHP is provided. I have a control panel which allows me to initialize MySQL for my use. The initialization creates a db, named celticblues_com (my domain is celticblues.com). So far, I have added a table to my database, and added the neccessary fields. Now I am at a total loss at what to do. I want to use PHP scripts to pull info from the db and search the db etc. I have contacted my support from FWS, but they point me to MySQL.com for Mysql commands technical support. Seems to me I would need to know how to set username/password to access the db from script etc. The bottom line question is can someone point me to information on what I need to do to be able to access(open/close) the db, retrieve/store information, etc. in this type of environment (i.e. MySQL provide by my host service, not installed by me)? Ed - 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 - 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: Need help on mysql/php
Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Quarta-feira, 6 de Junho de 2001 0:29 Para: Jorge Oliveira; Mysql@Lists. Mysql. Com Assunto: RE: Need help on mysql/php Thanks...this helped...Just had success in connecting to the MySQL server and dumping the db contents to the screenOne worrisome bit though...My username and password for connecting to the db on my host is my username and password for the web account. If I want to create dynamic webpages by pulling data from my db, won't I have to put this information (usersname and pw) in the php file and leave it on the server? Sounds pretty darn scary to me...maybe I am confused. Ed -Original Message- From: Jorge Oliveira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 12:47 PM To: Mysql@Lists. Mysql. Com Subject: RE: Need help on mysql/php Hi, Please refer to http://www.php.net/manual/en/ref.mysql.php Jorge Oliveira [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Terça-feira, 5 de Junho de 2001 21:31 Para: [EMAIL PROTECTED] Assunto: Need help on mysql/php I recently move my website to FastWebServers.com. MySQL and PHP is provided. I have a control panel which allows me to initialize MySQL for my use. The initialization creates a db, named celticblues_com (my domain is celticblues.com). So far, I have added a table to my database, and added the neccessary fields. Now I am at a total loss at what to do. I want to use PHP scripts to pull info from the db and search the db etc. I have contacted my support from FWS, but they point me to MySQL.com for Mysql commands technical support. Seems to me I would need to know how to set username/password to access the db from script etc. The bottom line question is can someone point me to information on what I need to do to be able to access(open/close) the db, retrieve/store information, etc. in this type of environment (i.e. MySQL provide by my host service, not installed by me)? Ed - 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 - 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: Need help on mysql/php
Hi, You are making a huge confusion... PHP is a server side scripting language that is used mostly for generate dynamic html pages. For example, let's say you have a file named test.php like this: ? $username=Me; $password=mypass; ... // slq queries here ... echo htmlbodyThis is a testbody/html; ? If you upload this file to your server and browse to it you will get this page: - htmlbodyThis is a test/body/html - The variables $username and $password are not displayed... Again, I recommend you to start reading on PHP and you will find it very easy to understand. Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Quarta-feira, 6 de Junho de 2001 0:49 Para: Jorge Oliveira Assunto: RE: Need help on mysql/php I assume that you mean that they cannot access the scripts if the extension of the file is .php3, but if I mix PHP within an HTML file, then all security bets are off? Ed -Original Message- From: Jorge Oliveira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 2:38 PM To: Ed Peddycoart Cc: Mysql@Lists. Mysql. Com Subject: RE: Need help on mysql/php Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Quarta-feira, 6 de Junho de 2001 0:29 Para: Jorge Oliveira; Mysql@Lists. Mysql. Com Assunto: RE: Need help on mysql/php Thanks...this helped...Just had success in connecting to the MySQL server and dumping the db contents to the screenOne worrisome bit though...My username and password for connecting to the db on my host is my username and password for the web account. If I want to create dynamic webpages by pulling data from my db, won't I have to put this information (usersname and pw) in the php file and leave it on the server? Sounds pretty darn scary to me...maybe I am confused. Ed -Original Message- From: Jorge Oliveira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 12:47 PM To: Mysql@Lists. Mysql. Com Subject: RE: Need help on mysql/php Hi, Please refer to http://www.php.net/manual/en/ref.mysql.php Jorge Oliveira [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Enviada: Terça-feira, 5 de Junho de 2001 21:31 Para: [EMAIL PROTECTED] Assunto: Need help on mysql/php I recently move my website to FastWebServers.com. MySQL and PHP is provided. I have a control panel which allows me to initialize MySQL for my use. The initialization creates a db, named celticblues_com (my domain is celticblues.com). So far, I have added a table to my database, and added the neccessary fields. Now I am at a total loss at what to do. I want to use PHP scripts to pull info from the db and search the db etc. I have contacted my support from FWS, but they point me to MySQL.com for Mysql commands technical support. Seems to me I would need to know how to set username/password to access the db from script etc. The bottom line question is can someone point me to information on what I need to do to be able to access(open/close) the db, retrieve/store information, etc. in this type of environment (i.e. MySQL provide by my host service, not installed by me)? Ed - 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
RE: Need help on mysql/php
On 05-Jun-01 Ed Peddycoart wrote: Thanks...this helped...Just had success in connecting to the MySQL server and dumping the db contents to the screenOne worrisome bit though...My username and password for connecting to the db on my host is my username and password for the web account. If I want to create dynamic webpages by pulling data from my db, won't I have to put this information (usersname and pw) in the php file and leave it on the server? Sounds pretty darn scary to me...maybe I am confused. Ed No, you put it in a php file with nothing but defines / data, say 'config.php' : php // Database *** define('DBHOST', 'localhost'); define('DBUSER', 'abc'); define('DBPASS', 'abc123'); --- and include('config.php') in your scripts. If the webserver is configured properly, access to this file will evaluate as php code; so nothing will get output. Better yet, put the file outside the $DOCUMENT_ROOT, in case your server is poorly configured. include($DOCUMENT_ROOT/../config.php); Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. - 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: Need help on mysql/php
At 10:37 PM +0100 6/5/01, Jorge Oliveira wrote: Hi again, You are right, your username and password will have to be on every PHP script that needs to use database. However, you don't have to be afraid because nobody can access the source of your PHP scripts - unless they are a good hacker! Actually, anyone else on the Web server host that has permission to install scripts for the Web server can access the source. I couldn't tell from the original message whether the Web server is shared with other people or not, but if you don't have your own server, you're exposed. I think you should pay a visit to http://www.php.net to understand how PHP works. Start with the basics and you will see that is reallY VERY simple. Be cool, Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -- Paul DuBois, [EMAIL PROTECTED] - 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: Need help on mysql/php
At 7:42 PM -0500 6/5/01, Don Read wrote: On 05-Jun-01 Ed Peddycoart wrote: Thanks...this helped...Just had success in connecting to the MySQL server and dumping the db contents to the screenOne worrisome bit though...My username and password for connecting to the db on my host is my username and password for the web account. If I want to create dynamic webpages by pulling data from my db, won't I have to put this information (usersname and pw) in the php file and leave it on the server? Sounds pretty darn scary to me...maybe I am confused. Ed No, you put it in a php file with nothing but defines / data, say 'config.php' : php // Database *** define('DBHOST', 'localhost'); define('DBUSER', 'abc'); define('DBPASS', 'abc123'); --- and include('config.php') in your scripts. If the webserver is configured properly, access to this file will evaluate as php code; so nothing will get output. Better yet, put the file outside the $DOCUMENT_ROOT, in case your server is poorly configured. include($DOCUMENT_ROOT/../config.php); However, if you and I both have virtual domains hosted by the same server, I can write a script that will read your config.php file. And then, for my next trick, I'll connect to your database and read (or destroy) all your data. :-) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- Paul DuBois, [EMAIL PROTECTED] - 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: need help
On Thu, May 17, 2001 at 06:36:23AM -0700, mansoor spake thusly: *] i m new to mysql, how i can convert a string 28-MAR-2001 to date *] In what language? -- -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Peter L. Berghold[EMAIL PROTECTED] Linux renders ships http://www.berghold.net NT renders ships useless - 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: need help on replication
Joe: AFAIR, as an ex NT4 sysadmin, system error 5 is access denied - you have a permissions problem somewhere. On NT4 these can be a swine to solve. Check out your NT system error logs as a starting point. HTH. David By the way, I once first tried to set up the slave on a NT machine. But for unknown (means I donot know) reasons, I can not even net start mysql on that machine now. The error message is system error 5. Did you meet this problem? If so, how did you solve it? thanks alot, Joe - 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: need help on replication
On Wed, May 09, 2001 at 10:29:42AM -0600, Joseph Chow wrote: Hi, there, This is my first try on this mailing list. I am a new user of mysql and need some help about replication on mysql 3.23.36. I had followed the manual to set up master/slave server. At the beginning, they are connected perfectly. All the modifications (i.e. create databases, insert values ..) on the master server were mirrored by the slave server. However, after I dumped some databases from the master to the slave, the bad things happened. The connection between the master and the slave was down. I failed to reconnect them by shutting down and restarting the master and the slave a couple of times. You'll need to look in the mysql error log on the slave and see what it says. That should give us/you a good idea what may have happened. Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878Fax: (408) 349-5454Cell: (408) 439-9951 MySQL 3.23.29: up 126 days, processed 780,401,285 queries (71/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: need help on replication
Hi, Jeremy, It is very nice to talk to you. Thanks for your information. It's working now, but I did nothing but going over the procedure again. I may make some mistakes during my operations. But it is really a good idea to keep an eye on the err log for solutions. By the way, I once first tried to set up the slave on a NT machine. But for unknown (means I donot know) reasons, I can not even net start mysql on that machine now. The error message is system error 5. Did you meet this problem? If so, how did you solve it? thanks alot, Joe -Original Message- From: Jeremy Zawodny [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 10:33 AM To: Joseph Chow Cc: [EMAIL PROTECTED] Subject: Re: need help on replication On Wed, May 09, 2001 at 10:29:42AM -0600, Joseph Chow wrote: Hi, there, This is my first try on this mailing list. I am a new user of mysql and need some help about replication on mysql 3.23.36. I had followed the manual to set up master/slave server. At the beginning, they are connected perfectly. All the modifications (i.e. create databases, insert values ..) on the master server were mirrored by the slave server. However, after I dumped some databases from the master to the slave, the bad things happened. The connection between the master and the slave was down. I failed to reconnect them by shutting down and restarting the master and the slave a couple of times. You'll need to look in the mysql error log on the slave and see what it says. That should give us/you a good idea what may have happened. Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878Fax: (408) 349-5454Cell: (408) 439-9951 MySQL 3.23.29: up 126 days, processed 780,401,285 queries (71/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: need help on replication
On Wed, May 09, 2001 at 11:18:14AM -0600, Joseph Chow wrote: Hi, Jeremy, It is very nice to talk to you. Thanks for your information. It's working now, but I did nothing but going over the procedure again. I may make some mistakes during my operations. But it is really a good idea to keep an eye on the err log for solutions. Indeed. By the way, I once first tried to set up the slave on a NT machine. But for unknown (means I donot know) reasons, I can not even net start mysql on that machine now. The error message is system error 5. Did you meet this problem? If so, how did you solve it? I can't help you much there. I really only use Windows when there are not other options available to me, so I haven't seen this problem before. Sorry. Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878Fax: (408) 349-5454Cell: (408) 439-9951 MySQL 3.23.29: up 126 days, processed 780,513,289 queries (71/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: Need help with 23.36
mysql use lum Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Didn't find any fields in table 'users' Database changed mysql select * from users; ERROR 1017: Can't find file: './lum/users.frm' (errno: 13) Please anyone. I really need some ideas. I copied my database files made with 23.29 to 23.26 and now I get this. I chowned mysql.mysql and chmoded 660. The location of the databases is good because I have some other databases created with 36 and they work fine. I copied ALL the database's files to /var/lib/mysql where the others are and I get this error. Any idea? Error code 13 means permission denied. How come your database is named 'lumina' and the directory it resides in (or at least the dir that mysql tries to find the tables in) is ./lum/ ? Shouldn't it be looking under lumina? Check that you don't have your database directories messed up under ~mysql/var/ The files are in the right directory with the right permissions and still I get the errors from above. - 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