Re: Can mysql execute this ? how can i do this ?
If you have id_categoria in both tables why don't you use join? Try this: select nome from categorias inner join categoriamembro on categorias.id_categoria=categoriamembro.id_categoria where id_membro=1807 []s Anderson Pereira Ataides Em Qui 06 Fev 2003 00:31, you wrote: Is this possible select nome from categorias where id_categoria in (select id_categoria from categoriamembro where id_membro=1807) in MySQL Thks [MsR] - 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: table relations
Nuno Lopes Try this: SELECT music_id, title, artist_name, country FROM music_table, artist_table WHERE music_table.artist_id = artist_table.artist_id AND country LIKE 'desired country' Anderson Ataides Em Sex 03 Jan 2003 07:57, you wrote: Hi everybody, I have a question about table relations and I would like you to help me. I have two tables in one server. The first tables has the following fiels: music_id; title; artist_id; chords The second one: artist_id; artist_name; country How can I JOIN this tables?? (I'm working in PHP, if it's matters). I want to print all musics from a specific country (first table) using the artist in second table. Can you help me building the SQL statement, please? Thanking in avance, Nuno Lopes - 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: More locking issues
From MySQL Reference Manual: ... Normally, you don't have to lock tables, as all single UPDATE statements are atomic; no other thread can interfere with any other currently executing SQL statement. There are a few cases when you would like to lock tables anyway: * If you are going to run many operations on a bunch of tables, it's much faster to lock the tables you are going to use. The downside is, of course, that no other thread can update a READ-locked table and no other thread can read a WRITE-locked table. * If you are using a table handler in MySQL that doesn't support transactions, you must use LOCK TABLES if you want to ensure that no other thread comes between a SELECT and an UPDATE. The example shown below requires LOCK TABLES in order to execute safely: mysql LOCK TABLES trans READ, customer WRITE; mysql select sum(value) from trans where customer_id= some_id; mysql update customer set total_value=sum_from_previous_statement where customer_id=some_id; mysql UNLOCK TABLES; Without LOCK TABLES, there is a chance that another thread might insert a new row in the trans table between execution of the SELECT and UPDATE statements. By using incremental updates (UPDATE customer SET value=value+new_value) or the LAST_INSERT_ID() function, you can avoid using LOCK TABLES in many cases. ... That is the way I work with MySQL. In almost all cases I do not need to lock tables. I only use it when I am updating more than one tables, because of chances of getting data integrity broken. Hope I could help. []s Anderson Pereira Ataides Em Qui 12 Dez 2002 16:09, you wrote: Hi, If you have more than one user connected to the database which handled the same tables, you need to use LOCK/UNLOCK tables. MySQL daemon don't lock tables or records if you don't require this. Regards, Gelu _ G.NET SOFTWARE COMPANY Permanent e-mail address : [EMAIL PROTECTED] [EMAIL PROTECTED] - Original Message - From: Jeff Snoxell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 12, 2002 6:57 PM Subject: More locking issues Hi, I'm new to MySQL. I see you all talking about locking databases etc... but isn't that the point of having a database server? So you don't have to worry about record locks? I'm designing the backend for a popular site where a user's visit will result in multiple read/write operations on a database. Is record locking something I definitely need to do? Thanks, Jeff - 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: MySQL vs. Oracle (not speed)
Let's see if I can convince your managers: 1. Support Oracle offers support, this is true, but if you want pay for support, you can buy it from MySQL AB. They have MySQL for free and they also have a licence you can buy and ask for support. If you want to keep free, this list is a good point for support. All messages posted here are answered. Some times you have strange answers, but you have of course ability to filter good ones. 2. Correcting bugs With Oracle, you have some programmers working on it to develop and keep it out of bugs. MySQL is free software, that means we have thousands or programmers around the world contributing with it. In free software world, almost all time, when a hacker find a bug in a software, he already give a solution to it, because he has free access to source code, meaning he can fix bug and contribute to software development. 3. Improvements I can use the same argument for correcting bugs. MySQL is free software. If I have enouth knowledgement to develop subqueries, I can make it work and contribute with software. If maintainers of MySQL approve it, it is distributed together with MySQL. See case of foreign keys and transaction support. When I started with MySQL, they did not have even plans to develop this and suddenly we have support for transactions and foreign keys. How could it happen? INNODB and Berkeley DB, contributed software. So if you want capability to develop improvement, MySQL is a better choice. 4. Thid part support If you do not want Oracle support, you of course may want some else's support. We have people that offers support for Oracle products, but how many? And how much will they ask for their support? MySQL is becoming (I think it is already) default database in free software world. All Linux distributions you buy or download, offers MySQL as default database and PostgreSQL as the second choice. Because of this, we have more preople working with MySQL. If someone will offer support but it's expensive, it is easy to find someone else to help you with lower price. 5. Easy of use Once, I tried to work with a lite version of Oracle, but I could not even install it, because of its hardware requirements. Later I bought a new computer, but I still could not install it. In installation, I had to have some knowledgements of Oracle. I tried to work wit PostgreSQL, and difficult came after instalation. I could not easily understand its security issues, and it's interface for programming language would require some hard study to put it to work. With MySQL, as I installed it, it was ready to work. Simply reading tutorial in documentation I could already create databases, users, tables and put it to work for me. Also interface with programming language is much easier to understand. And if you have MS-Access as front-end, you can easily link MySQL tables to it and work as it was Access's tables. You can do all of it without much previous knowledgement. So if you want fast learning, and development, MySQL is your choice. Want more? I could give you more arguments, but I think this should be enough. Hope I could help you. Anderson Pereira Ataides [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
security
Why should I close port 3306 used by mysql? What would happen if a hacker use this port? Anderson Pereira Ataides - 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: Joining question
You gave the answer. Using left join it will work and give you NULL values for not found records. I had a similar problem here and left join worked ok. Bye, Anderson Ataides = Em Quarta 24 Julho 2002 03:51, you wrote: Hi I'm designing 2 tables, where tabProds has the foreign key of tabUsers. So when I want to join them I use.. WHERE tabProds.usr_ID = tabUsers.usr_ID Ok But the thing is that sometimes will not be possible to specify a user when you insert a Product(becaouse we don't know at that time)... And I'm anticipating the query mentioned above would not display the products that doesn't match any user's ID, AND I want those records to be showed too. Would be like this...? WHERE (tabProds.usr_ID = tabUsers.usr_ID) or (tabProd.usr_ID= Null) But, with this query, what is going to show on the User's columns when it gets a Null field..? ProdID UserID UserName 232John 34Null? --- What's going to happen here..? 454Pedro Or is there anohter options..? like Left joins.. and all that, (I haven't analize them yet) I know you may think... Well do the test and see it, well yes, is just that affects the way I'm thinking to design the web system, and I would like to know when I'm on the DB design and before the programming Thank you jgarza - 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
Fwd: Re: using a php page to reboot linux
Are you sure you want to do that? Since php can call local programs, you can call one to reboot your computer. I think it's not a good idea to allow it. Anderson Pereira Ataides Em Quarta 17 Julho 2002 16:38, you wrote: Hi mysql list members, Is it possible to reboot the linux server through a PHP page. Like a client clicking on a button in a php page and that would result in rebooting the linux server. Can this be done?? Pls help, Regards, Harpreet Kaur _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.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: [ date format ]
Em Ter 16 Jul 2002 18:19, Elby Vaz escreveu: Hi, the date format of MySql is /mm/dd (2002/07/16) right? Wrong. The date format of MySQL is -mm-dd. How I do to insert the date typing in my form dd/mm/ (16/07/2002)? It is possible? You have to format your date to insert into MySQL. Are you using PHP? If yes, you can try this line into your program: $mysql_date = substr($your_date, 6, 4) . - . substr($your_date, 3, 2) . - . substr($your_date, 0, 2) Hope this can help you. Anderson _ MSN Photos é a maneira mais fácil e prática de editar e compartilhar sua fotos: http://photos.msn.com.br - 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