802 Posted Topics

Member Avatar for aquamarine_kath

Look in the system log for the cause of the error. In Vista you'll find it at [ICODE]%SystemRoot%\system32\eventvwr.msc /s[/ICODE], in Linux at [ICODE]/var/log/messages[/ICODE]

Member Avatar for sbhavin
0
2K
Member Avatar for javaAddict

Oracle bought MySQL to get rid of the free competitor. That may suffice to prove that MySQL in standard situations (like running a website) can do anything which Oracle can, only for free. If you want the bleeding edge, try MariaDB instead.

Member Avatar for javaAddict
0
270
Member Avatar for agriz

Create a temporary table (country_id, city_name), load your 5.000 queried records into it and then form a join between this temporary table and the big cities table.

Member Avatar for agriz
0
192
Member Avatar for amityadav9314

To insert the comment you'll have to know to which blog entry it belongs. To insert a comment for entry with id=2, use: [CODE]INSERT INTO cms.comments(blog_id, name,email,comments_body) VALUES (2, 'theName', 'theMail', 'theComment' );[/CODE] You cannot use a WHERE clause in an INSERT statement.

Member Avatar for SANJAY26
0
354
Member Avatar for riahc3

By means of replication. [url]http://dev.mysql.com/doc/refman/5.1/en/replication.html[/url]

Member Avatar for smantscheff
0
47
Member Avatar for riahc3

Foreign keys are to guarantee database integrity. If you maintain only the local database and update the remote by use of federated tables, then integrity errors on the remote should not occur - except with incomplete transactions. Do federated tables support transactions?

Member Avatar for riahc3
0
877
Member Avatar for riahc3

I don't think there is an API or function to connect to an external database from within a stored procedure. You could alternatively set up a complete database replication or execute the DML statements from your scripting environment by use of transactions which you rollback if one command fails.

Member Avatar for riahc3
0
3K
Member Avatar for FridgeFreezer

Look for an mysql primer which explains the uses of the INSERT, UPDATE and DELETE stamements to you. For specific help, post the relevant table structures you're using.

Member Avatar for FridgeFreezer
0
125
Member Avatar for mr. y

If that doesn't help, maybe you should spread your database on several servers by means of partitioning. [url]http://dev.mysql.com/doc/refman/5.1/en/partitioning.html[/url]

Member Avatar for smantscheff
0
161
Member Avatar for newbie26

If your partition runs out of space you have to increase it. This has nothing to do with mysql. You can move the mysql data to a larger partition in 4 steps: 1) stop the mysql daemon 2) move the data directory (default /var/lib/mysql, look in my.cnf) to another directory …

Member Avatar for smantscheff
0
215
Member Avatar for reinere

Your query tries to compare the equality of a single value with a whole set. Try instead: [CODE]SELECT * FROM usergroups u, links l where u.`user_id` = '1' and find_in_set(u.group_id,l.group_id);[/CODE]

Member Avatar for reinere
1
269
Member Avatar for slasherpunk

As the error message asks: [QUOTE]Is there a MySQL server running on the machine/port you are trying to connect to?[/QUOTE] Install the mysql command line client and test if it can connect to your mysql server on your local machine. Or, if you're running windows, have a look at the …

Member Avatar for slasherpunk
0
15K
Member Avatar for danielbala

If you have a concrete question, a piece of code which doesn't work or a query which goes amiss, post it and we will try to help.

Member Avatar for danielbala
0
161
Member Avatar for danielbala

Use an enum field with literal values. Define it as myField enum('admin','manager','staff') instead of numerical values.

Member Avatar for smantscheff
0
104
Member Avatar for rotten69

The error message is from Apache, it has nothing to do with MySQL. Look in your apache configuration file (httpd.conf) and in the local directory's .htaccess files for access restrictions.

Member Avatar for rotten69
0
166
Member Avatar for chandbasha

Export all rows in a text file. Fold your various in- an exclusion conditions into a regular expression and filter the textfile using grep. Might be much faster than mysql.

Member Avatar for fobos
1
241
Member Avatar for creativeartbd

[CODE]$result = mysql( "select * from users where url='$url' and name='$name'" ); if (mysql_num_rows($result) > 0) echo "Error: User already in database"; [/CODE]

Member Avatar for debasisdas
0
121
Member Avatar for rotten69

You have to drop the foreign key relation before you can drop the index. Have a look at the output of [CODE] SHOW CREATE TABLE likes [/CODE]It will show you the internal name of the foreign key constraint which you set up with your first statement. You have to drop …

Member Avatar for rotten69
2
6K
Member Avatar for sirlink99

Have a look at the LOCAL option in the upload statement and make sure that upload.txt is readable by the mysql daemon (not by the mysql user). See [url]http://dev.mysql.com/doc/refman/5.1/en/load-data.html[/url]

Member Avatar for smantscheff
0
88
Member Avatar for liphoso

Dump the database with the command line tool mysqldump and import the dump file using the command line tool mysql on the second server.

Member Avatar for drjohn
0
82
Member Avatar for joy39

A comma is missing at the end of the previous line. address TEXT NOT NULL[COLOR="Red"][B],[/B][/COLOR]

Member Avatar for joy39
0
112
Member Avatar for Octipus

Replace [CODE]CONCAT('£', act_price) AS Amount,[/CODE] by [CODE]sum(act_price) AS Amount,[/CODE]

Member Avatar for Octipus
0
218
Member Avatar for peterpa

Try to find the shift key on your keyboard and unlock it. What response do you expect from the server?

Member Avatar for smantscheff
0
60
Member Avatar for xecure

If you have a function distance(zip1,zip2), you can use it in a query: [CODE]select a.username, b.username, distance(a.zip_code,b.zip_code) from user a, user b where a.username='coolUser' and b.username='blueUser'[/CODE] If you want all users sorted by distance to a given user, query [CODE]select a.username, b.username, distance(a.zip_code,b.zip_code) from user a, user b where b.sex …

Member Avatar for smantscheff
0
184
Member Avatar for showman13

[QUOTE]That is a mistake I won't make again because I'll write a script to do [/QUOTE] Yes you will. And your database will crash someday. And then you'd better had some backup mechanism - and if you had, you might retrieve the lost information from there. So set the backup …

Member Avatar for showman13
0
201
Member Avatar for hari.sarvothama

You should at least alter the column names. How do you anyone expect to debug this database with names like "s1" or "regno"? For normalization purposes the subjects should be in their own table and there should be a relation students_and_subjects. If regno is the student's id and s1 to …

Member Avatar for smantscheff
0
98
Member Avatar for morrisproject

Most probably your child table contains values which are not in the master table. Check that all asset_type values of the child occur in the master.

Member Avatar for smantscheff
0
150
Member Avatar for sirlink99

If your web host is any good chances are that you won't be able to access your database from the outside. In shared servers mysql is usually ocnfigured to respond only to requests from the local machine, for example from the webserver which runs phpMyAdmin. Try to access your database …

Member Avatar for sirlink99
0
143
Member Avatar for jscer

Try: [CODE]UPDATE productbalance SET Quantity_OnHand = ( select sum(Product_OrderQuantity) from addproduct where Product_ID= productbalance.Product_ID - select sum(Sale_Quantity) from sellproduct where Product_ID= productbalance.Product_ID + select sum(BoL_Product_Quantity) from reportfoundproduct where Product_ID= productbalance.Product_ID ) where Product_ID= productbalance.Product_ID ;[/CODE]

Member Avatar for smantscheff
0
194
Member Avatar for Shockbox
Member Avatar for felix001

You can a) use an interface like Navicat which is capable of global search/replace operations; b) dump the whole database to a file, replace the string on the file and reload it into the database. To the best of my knowledge there is no mysql function which does what you …

Member Avatar for smantscheff
0
150
Member Avatar for sirlink99
Member Avatar for GuruMS

How do you want to learn anything if you don't even try? If this is really a MySQL question, use the LIMIT clause in your query. If it is standard SQL, use something like [CODE]SELECT * from Students A WHERE (SELECT count(*) FROM Students B WHERE A.marks < B.marks) = …

Member Avatar for smantscheff
0
58
Member Avatar for anand01

If you use the InnoDB engine with foreign keys, both primary and foreign key tables must have indexes on the common key field. Even with other engines indexes in all tables linked by foreign keys will boost performance.

Member Avatar for anand01
0
88
Member Avatar for jatashankar

Add a column to your table which contains the function value, and create a trigger which computes this function value on any update of the record. Then you can use an index on this column.

Member Avatar for jatashankar
0
85
Member Avatar for Virangya

You have to bracket the clauses of the OR condition: [CODE]SELECT * FROM rwb_bk_schedule s INNER JOIN rwb_bk_rooms r ON s.room_id = r.room_id WHERE s.room_status=1 AND r.room_name=$room AND (start_date BETWEEN $sdate AND edate OR end_date BETWEEN sdate AND $edate) [/CODE]

Member Avatar for smantscheff
0
135
Member Avatar for devinodaniel

Debug all variables of line 31. Probably you'll find that $to contains two domain names - one which the user entered and one ('example.com') which your program added.

Member Avatar for dineshsjce
0
196
Member Avatar for minitauros

What do you mean by "does not work" ? Show the relevant table structure. How about this: [CODE]select count(*) from persons where user_id=@super + count(*) from companies where user_id=@super + count(*) from artists where user_id=@super + count(*) from events where user_id=@super[/CODE]

Member Avatar for smantscheff
0
129
Member Avatar for qwertpink

[CODE]select * from project p, replies r where p.project_id=r.project_id and r.mydate = (select max(mydate) from replies rr where rr.project_id=p.project_id group by project_id) [/CODE]

Member Avatar for qwertpink
0
181
Member Avatar for BenzZz

What makes a customer a customer or a driver a driver if not the fact that the customer books a driver. So what is the use of the customer and driver tables? They are just users and should be stored in a common table, sharing a lot of attributes - …

Member Avatar for BenzZz
0
322
Member Avatar for riya_developer

You can use the variable names of your parameters in stored procedures. But what do you mean with "append to query"? Give an example.

Member Avatar for smantscheff
0
70
Member Avatar for staticwave

To me it seems that you just need a regular database backup. I would set up a daily cronjob which dumps the whole database into a file with the current date in the filename. Then you can afterwards reconstruct any state of the database for a given date. Another option …

Member Avatar for smantscheff
0
1K
Member Avatar for MDanz
Member Avatar for smantscheff
0
154
Member Avatar for JukesK

If you query more than one table you have to - list all tables in the FROM clause: add ", userlist" to the FROM clause; - use a where clause which semantically links the rows of one table to the other. This is missing in your where clause. It is …

Member Avatar for smantscheff
0
158
Member Avatar for solomon_13000

Your query [CODE]SELECT id FROM vwRetrieveCorporateDetails WHERE companyName=companyName AND rocNo=rocNo AND country=country [/CODE]has the same names on both sides of the equation signs. Which means that all records are retrieved. You have to use variable names which are not the same as the column names.

Member Avatar for solomon_13000
0
866
Member Avatar for techker

[CODE]SELECT N_Etudiant, Professeur, count(Professeur) as CP FROM Foyer GROUP BY N_Etudiant, Professeur HAVING CP > 2; [/CODE]

Member Avatar for techker
0
94
Member Avatar for twitah

In PHP you do the same as in MySQL: You bracket all queries which belong to a transaction with [ICODE]BEGIN TRANSACTION[/ICODE] and [ICODE]COMMIT[/ICODE] or [ICODE]ROLLBACK[/ICODE], respectively. This works only on InnoDB tables, though.

Member Avatar for smantscheff
0
169
Member Avatar for ppetree

Categories are a tree structure. You cannot write a query which returns a recursive structure. Therefore I recommend that you write a user defined function (UDF) which combines all parent categories for a given category in a string which your application then can display.

Member Avatar for smantscheff
0
210
Member Avatar for Draucia

The mysql_query function sets an internal pointer, the cursor, to record 0. Each subsequent call of mysql_fetch_array retrieves the current row and advances the cursor by 1 row. If you call mysql_fetch_array 3 times, the result of the last call will be the 3rd row.

Member Avatar for smantscheff
0
119
Member Avatar for emily-bcot

You should not compare explicit values with float values. Due to rounding and precision issues the value of a float can only be of a limited subset of all real numbers. It is stored as the number which is closest to the input value. Therefore mysql does not store 0.6 …

Member Avatar for smantscheff
0
217

The End.