RE: finding next and prev record in mysql
-Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: Friday, May 11, 2007 9:25 AM To: Mogens Melander Cc: mysql@lists.mysql.com Subject: Re: finding next and prev record in mysql Mogens Melander wrote: On Fri, May 11, 2007 07:15, Richard Kurth wrote: How would I find the next id and the prev id in sql statement like the one below. The id number is not going to be in order so I can't do a or limit 1 on the search SELECT id FROM contacts WHERE category = '5' AND subcategory = '1' AND members_id= '8' ORDER BY lastname The PHP variant could look like (prev id): SELECT id FROM contacts WHERE category = '5' AND subcategory = '1' AND members_id= '8' AND lastname $_POST['lastname'] ORDER BY lastname LIMIT 1; I forgot to say earlier: my article is about finding both next and previous records in a single query. I don't know if this is what you need or not but I assumed it was. Yes I read your article but I can't figure out how to use it with my existing sql statement. This is just an example of the search sql statement it could be different than this. I all ready know what Id number I what to find the prev and the next recorded number around. Say the id number is 52. If I print out the list of ids the one before number 52 is 503 the one after is 302. How can I use your script to find these numbers using the same sql statement. I am just not sure how to incorporate it in to the search. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: finding next and prev record in mysql
This good for giving me the next recorded but it will not give me the prev recorded that is the one I am having problems with You actually do want to use the limit clause, but use 2 parameters. The first number is which record you want to start at, the second is how many records you want. So limit 2,1 will give you the second record. It's the same query every time, you're just incrementing the first number of the limit clause. - Original Message - From: Richard Kurth [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Friday, May 11, 2007 1:15 AM Subject: finding next and prev record in mysql How would I find the next id and the prev id in sql statement like the one below. The id number is not going to be in order so I can't do a or limit 1 on the search SELECT id FROM contacts WHERE category = '5' AND subcategory = '1' AND members_id= '8' ORDER BY lastname -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
finding next and prev record in mysql
How would I find the next id and the prev id in sql statement like the one below. The id number is not going to be in order so I can't do a or limit 1 on the search SELECT id FROM contacts WHERE category = '5' AND subcategory = '1' AND members_id= '8' ORDER BY lastname
Trouble with WHERE Clause
I have two tables I just what the data from the 1 table that is not in the 2 table So in this example I what row formelements_id 22 and 23. I have tried different sql statements one is below SELECT customformelements.formelements_id ,dbelements.customer_id,customformelements.formelements_field_type, customformelements.formelements_field_caption FROM customformelements ,dbelements WHERE customformelements.members_id = '8' AND customformelements.formelements_id dbelements.dbelements_field_name Of course this will loop through and give me every field that does not equal 18 which is all but 18 Any Suggestions 1 Table formelements_id formelements_field_type formelements_field_caption members_id 18 text Data1 8 19 date Data1 8 20 text Data1 8 21 text Data1 8 22 text Data1 8 23 text Data1 8 2 Table dbelements_field_name dbelements_field_value members_idcustomer_id 18This is a test 8 17 19This is a test 8 17 20This is a test 8 17 21This is a test 8 17 18This is a test 8 59 19This is a test 8 59 20This is a test 8 59 21This is a test 8 59
Configuring two mysql servers on one linux server
I am looking for instructions on how to configure mysql on a Linux server with an already running version. I would need it run on a different port and all the files to be installed in one location. I don't what it to interfere with the standard install of mysql. Also I would like it to install with just the bare minimum required to run one database with a php program. Is this all possible. I have read the manual about configuring mysql but have not figured it out. -- Best regards, Richard mailto:[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
conflicts with new version
I am trying to reinstall mysql on a cobalt server I removed the first version but when I go to install the new version I get this message below saying it conflicts with another version could you tell me how I can correct this. I have looked through the entire directory structure and can not find any other files that relate to mysql file /etc/logrotate.d/mysql from install of MySQL-3.23.39-1 conflicts with file from package MySQL-3.22.32-1 file /etc/rc.d/init.d/mysql from install of MySQL-3.23.39-1 conflicts with file from package MySQL-3.22.32-1 file /usr/bin/isamchk from install of MySQL-3.23.39-1 conflicts with file from package MySQL-3.22.32-1 file /usr/bin/isamlog from install of MySQL-3.23.39-1 conflicts with file from package MySQL-3.22.32-1 file /usr/bin/mysql_install_db from install of MySQL-3.23.39-1 conflicts with file from package MySQL-3.22.32-1 file /usr/bin/mysql_zap from install of MySQL-3.23.39-1 conflicts with file from package MySQL-3.22.32-1 Best regards, Richard mailto:[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
Problem starting Mysql
I keep getting this message in the mysql .err file I have no id as to what to do or even look at. 010519 11:57:54 mysqld started /usr/sbin/mysqld: ready for connections 010520 4:02:33 /usr/sbin/mysqld: Binlog closed, cannot RESET MASTER Status information: Current locks: key_cache status: blocks used: 1 not flushed: 0 w_requests: 0 writes: 0 r_requests: 0 reads: 0 handler status: read_key:0 read_next: 0 read_rnd 0 read_first: 0 write: 0 delete 0 update: 0 Table status: Opened tables: 0 Open tables:0 Open files: 0 Open streams: 0 010521 3:11:43 /usr/sbin/mysqld: Normal shutdown 010521 3:11:44 /usr/sbin/mysqld: Shutdown Complete 010521 03:11:44 mysqld ended Best regards, Richard mailto:[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
Grant
I am looking for different views about this I have a few question about Granting privileges to a user 1. Do you have to give them GRANT SELECT,INSERT,UPDATE, DELETE,CREATE,REFERENCES,DROP,INDEX,ALTER for them to use their database? 2. Is it best to give them the least amount of privileges? 3. Is this the best way to do it were this gives no privileges in the user database and all the privileges in the db database GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,REFERENCES,DROP,INDEX,ALTER ON $userdatabase.* TO '$newuser'@'$domaname' IDENTIFIED BY '$newuserpass' 4. How would I wright this to give them privileges in the host database. For your information I have read the Manual a number of times I am just looking for other views. Best regards, Richard mailto:[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
can not see data or tables in database
I set up a couple of databases last night in mysql and every thing is working just fine. Today when I try to access the data it is not there Using phpMyAdmin when I look at the databases that are completely empty of tables and data that also includes the mysql database. If I start up telnet and go into mysql it shows that all of the tables and data are their including the mysql data. This seems realy strange to me. Could you tell me what I need to do to correct this problem or at lest looking in the right direction. Thank you Richard Kurth - 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[2]: can not see data or tables in database
Hello B., Thursday, May 03, 2001, 11:42:39 AM, you wrote: I set up a couple of databases last night in mysql and every thing is working just fine. Today when I try to access the data it is not there Using phpMyAdmin when I look at the databases that are completely empty of tables and data that also includes the mysql database. If I start up telnet and go into mysql it shows that all of the tables and data are their including the mysql data. This seems realy strange to me. Could you tell me what I need to do to correct this problem or at lest looking in the right direction. B. Perhaps a problem with rights.. (settings in phpmyadmin not being saved?).. B. Not using phpmyadmin myself.. did read about it. None of the programs on the web can access the mysql not just phpmyadmin. It was working fine before yesterday and now it just wont work. is there anything that I should check on the server or would it be best to uninstall mysql and reinstall 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
HELP can not see data or tables in database
mysql running on cobalt raq4 have look through the archives and looked at the manual I can not access the databases from the web browser I get empty databases When in at telnet erased all the databases including mysql ran mysql_install_db logged back in with the web browser and the tables were there stopped mysql restarted mysql logged back in with the web browser databases were there but no tables I can see the tables if I telnet in and use mysql Command What is going on have done this about 6 times B. Perhaps a problem with rights.. (settings in phpmyadmin not being saved?).. B. Not using phpmyadmin myself.. did read about it. None of the programs on the web can access the mysql not just phpmyadmin. It was working fine before yesterday and now it just wont work. is there anything that I should check on the server or would it be best to uninstall mysql and reinstall it. B. Dunno.. What does the logfile say.. B. Remember to read the manual and this lists archive about trouble shooting.. B. If it's on windows the you should reboot.. solves almost any windooz problem. B. There is a seachable manual at www.mysql.com B. Or wait a while to see if any other suggestion comes up.. B. Bye, B. B. B. - B. Before posting, please check: B.http://www.mysql.com/manual.php (the manual) B.http://lists.mysql.com/ (the list archive) B. To request this thread, e-mail [EMAIL PROTECTED] B. To unsubscribe, e-mail [EMAIL PROTECTED] B. Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- Best regards, Richardmailto:[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
Could sombody please HELP me
I have a major problem could somebody take a seeress look at this mysql running on cobalt raq4 I have looked through the archives and looked at the manual can not find anything to explain this nothing in the mysql log file I can not access the databases from the web browser I get empty databases Went in at telnet erased all the databases including mysql ran mysql_install_db logged back in with the web browser and the tables were there stopped mysql restarted mysql logged back in with the web browser databases were there but no tables I can see the tables if I telnet in and use mysql Command What is going on have done this about 6 times I really need to fix this Should I reinstall mysql? Should I shoot my server? -- Best regards, Richardmailto:[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
can not see data or tables in database
I set up a couple of databases last night in mysql and every thing is working just fine. Today when I try to access the data it is not there Using phpMyAdmin when I look at the databases that are completely empty of tables and data that also includes the mysql database. If I start up telnet and go into mysql it shows that all of the tables and data are their including the mysql data. This seems realy strange to me. Could you tell me what I need to do to correct this problem or at lest looking in the right direction. Thank you Richard Kurth - 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