802 Posted Topics
Re: You need 1 table for all the teams (id_team, nationality, id_group) 1 table for the matches between teams (id_team_1, id_team_2, result), various views for quarter to final matches depending on the match results of the group matches | |
Re: I do not understand your select formula, but it seems to me that you have to introduce a zone function by which you can GROUP users BY zones and then select only the first (or n-th) user from each group. So the question is: What exactly is a zone? | |
Re: [QUOTE] Host localhost is not allowed something like than[/QUOTE] It pays to read error messages a little more closely than "something like that". What does it say exactly? Probably 'user@localhost is not permitted' or [I]something like that[/I]. Try to connect with the mysql command line program and [ICODE] mysql -uroot[/ICODE] … | |
Re: If this is a recurring task, you should use triggers or (with MariaSQL) virtual columns. | |
| |
Re: I strongly support Sorcher's advice. Don't use a framework until you have hand-coded it all at least once yourself. Then move on to facilitate the job with a framework. Otherwise you will never know what you are actually doing. | |
Re: Erase all back-ticks. `OWNER.OWNER_ID` is interpreted as a field name, not as a table- plus field name. Or code `OWNER`.`OWNER_ID` (urrhg) | |
Re: Your queries look fine, and I don't know any query generator which would render them better or more compact or readable. I only wonder why in your last query you use a left join instead of an inner join. | |
Re: Look up group_concat: [ICODE]select group_concat(id) from <yourtablenamehere> group by ''[/ICODE] | |
Re: What is the exact error message? Also, omit the spaces between parameter flags and the parameters: [ICODE]mysqldump -uroot -ppass**** coke_pos > testbc.sql [/ICODE] | |
Re: Your query looks fine. What's the problem with it? [If this answer is of any help, please send article 2 to my address.] | |
Re: In short: don't. Hire a programmer for the job who will achieve in days what you will likely spend months with. If you still want to do it yourself, get some working knowledge of Apache/PHP/Mysql. | |
Re: No. If an employee belongs to exactly one department, there must be no reference to the organization in the employee record but only to the department. | |
Re: These are not database terms related to MySQL. Ask your teacher to explain what he meant. Maybe a table with a field for headers and a field for sub-headers. Or two tables in a 1:n relation. | |
Re: MySQL does not have a regex replacement function. Either you code an internal routine, or you use an external tool capable of regex replacements. I would use PHP and the preg_replace function, or export the whole database to a text editor like EditPad and replace it there, or - if … | |
Re: You have to provide indexes to the array variables in your form, and on the receiving side you have to walk through the arrays which those indexes constitute. For example: [CODE]echo "<div class='kywrdformcontnr'><div class='kywrdform'>מילת מפתח:</div> <input type='text' name='keyword[[COLOR="Red"]1[/COLOR]]' class='kywrd1' /></div>"; ... for ($i = 0; $i < MAXINDEX; $i++) { … | |
Re: Do a UNION query which combines all tables together with a table ID. Make it a view. Then query this view for ID, Title, Max(Date), Count(*) GROUP BY tableID. | |
Re: Set up your table, fill it with some test data and let MySQL EXPLAIN your query. Then try an alternative approach using two left joins from the likes table into itself. See which one is more readable and more efficient (in terms of the EXPLAIN results). Try to guess which … | |
Re: Submit a complete test case with CREATE TABLE statements and INSERT statements and the queries which do not work as expected. I'm sure that you'll find your error when you prepare the test case. | |
Re: This looks like a somewhat awkward table setup. You'd better have one table for visitdates and one for addresses. | |
Re: If you have a well-structured programming style you can put your whole website script into one file. If your input and your processing code is in the same file chances are higher that you (and your fellow programmers) spend less time searching for it. And re-factoring might be easier, depending … | |
Re: 1) Show your login/logout code. 2) Show the exact error message. Does it really say "Unidentified value" -? | |
| |
Re: What does "fairly large" mean? 1.000 users, 10.000, a million? If it's below a million you should care primarily for coding and usage efficiency, not for performance. MySQL is quite performant itself. Avoid the wildcard * in your queries, though. So it boils down to a question of standard table … | |
Re: Well, normalization-wise you can't. The transaction ID is an easy way to refer to the checkout table in relations, but it does not solve your original problem. The three column unique index (cardnumber,libraryid,chekcoutdate) which urtrivedi proposed is a step further, but still the user cannot checkout a book on the … | |
Re: Follow the standard procedure for normalization. Make a list of all the fields which you will have to store and resolve the functional dependencies. Do not store anything which can be computed (for example the number of matches). Have a separate lookup table for each list/dropdown value. And do not … | |
Re: Resolve the functional dependencies to get to 3NF. Each user has exactly one password, but obviously can have several usernames on various protocols with single passwords. So the only dependent value which should go in the primary table together with the user name is the password: [ICODE]Table Users (id_user, username, … | |
Re: Google for "cartesian product". When you query two tables, the result set is the cartesian product of those two tables, which means, each row of table1 is combined with each row of table2, so you get a result set of n1 * n2 rows. The query which you propose filters … | |
Re: Aside from utridevis proposal to get at the error itself, your code is pathetically awkward. How can you know how many rows and how many variables you will have? Construct a loop instead which reads from server1 and imports into server2 one row at a time. Also, if I had … | |
Re: Your query shows the cartesian product of your tables. Since you have two colors for the product and two images, the result has to have (at least) 4 rows. Maybe you can use the group_concat function to pack all product and all image values in only one field which you … | |
Re: Just read the error message carefully. And then erase one of the double "INTO into" from your query. | |
Re: You confused formatID and formatType. Instead of [CODE]$formatID = mysql_query("select formatID from format where formatType = '$format'") OR die(mysql_error());[/CODE] code [CODE]$formatID = mysql_query("select formatID from format where format[COLOR="Red"]ID[/COLOR] = '$format'") OR die(mysql_error());[/CODE] | |
Re: Show the table definitions (the CREATE TABLE statements). And your design is flawed. Do not add a column for each category but store categories in their own table and refer to that table. | |
Re: Your clients need access to a mysql server, either on their local machines or a server in their own network or a server which is accessible through the internet. So either you setup a mysql server on each client machine, or you set up a server in their network, or … | |
Re: Please submit some test data (as CREATE TABLE and INSERT statements). Regarding table design, it would be easier for you with normalized tables. Create a table favorite_game with person_id and game_id instead of your favorite_game_xx fields. | |
Re: I don't know about C# but I noticed a design flaw in your query. Do not use more than one literal value to link the two tables: [CODE]SELECT * FROM `Families`, `Members` WHERE `Families`.`FamilyId`='132' AND `Members`.`FamilyId`=`Families`.`FamilyId`;[/CODE] In your sample code you use two different FamilyIds which is exactly the kind … | |
Re: Start at the beginning, go right through the middle and up to the end. For further help please clarify your request. | |
Re: To my knowledge there is no tee statement in mysql server. You have to process the log file from the OS level or use the mysql command line client which knows how to tee. | |
Re: Pritaeas is right about unique fields. You could bracket your select and insert query into a transaction, but that would not exclude the remote possibility that someone with direct access to the database might enter duplicate names and email addresses - for example an admin who is not using your … | |
Re: JOIN is a part of a clause for querying related tables, not for design. You are on the right track. Use foreign keys wherever possible to enhance database integrity. No, they don't harm the performance except with large insert or update operations. But unless you have millions of users you … | |
Re: With your design you have to allow NULL values in the foreign key fields so that an order can be related either to a customer or to an admin. But that would leave room for orphaned orders with neither customer nor admin associated with them. Also then an order could … | |
Re: What for would you need nl2br when storing the values? You need this function to display line breaks in HTML, not to store them in the database. Use [CODE]INSERT INTO global_leave_replacement_application (pic_staffcode) VALUES ('$pic_staffcodeS')"[/CODE] | |
Re: How exactly did you export and import it and what error message do you get? Use mysqldump for export and the mysql command line interface for import. Make sure that the mysql user account on the import side has the right to create tables. | |
Re: If you are working with windows, start xampp-control in the xampp directory for an interface to the various services. Alternatively you can start/stop the services with NET [START|STOP] MYSQL NET [START|STOP] APACHE2.2 from the command line. Also have a look at the error log in /xampp/apache/logs. my.ini should be in … | |
Re: DESC is a reserved keyword in (my)sql used with ORDER BY. Don't name your fields as reserved keywords. | |
Re: You connect to mysql by supplying a username, a password and optionally a port and a database name to you connecting interface, be it the mysql command line client or JDBC or ODBC or PHP or whatever. Server versions on linux and windows (WAMP/LAMP/ work alike. The only practical difference … | |
Have a look at this HTML code. In IE7 it displays two rows of a table-like form, much the same as in Firefox 3.x, 4 and Chrome. Now uncomment the [ICODE]"<!--div>abc</div-->"[/ICODE] and look again. Now the row spacing has become much larger, about 1em. I don't have a clue where … |
The End.