802 Posted Topics

Member Avatar for Morta
Member Avatar for aldm

There is a REPLACE statement in mysql with similar meaning as INSERT except that rows with duplicate keys will be deleted before the insertion. The alternative is the INSERT IGNORE statement which will skip any new rows with duplicate keys.

Member Avatar for smantscheff
0
175
Member Avatar for duffy12

In which format do you have the "huge data"? In general I'd recommend that you use the mysql command line client and the LOAD DATA statement.

Member Avatar for duffy12
0
136
Member Avatar for Mindpowerh

The mysql storage format is YYYYMMDD. If you want to enter the data in another format you have to convert it in your application to and from the target date format.

Member Avatar for anand01
0
297
Member Avatar for suley04

You are trying to enter a payment with a user ID for which there exists no user. Show us the table contents and your insert statement for further help.

Member Avatar for suley04
0
346
Member Avatar for sammry
Member Avatar for sammry
0
296
Member Avatar for acakaliman
Member Avatar for smantscheff
0
464
Member Avatar for andreas.cyp

Yes, that would be the first step. The second step is to ensure relational integrity, which means that your system has to make sure that only valid student IDs and advisor names can be entered. Therefore you need also a student table and an advisor table and two foreign key …

Member Avatar for smantscheff
0
77
Member Avatar for elcubanoluis

You cannot have variable names with blanks in HTML forms. Rename your form variables which you retrieve via the $_POST array.

Member Avatar for smantscheff
0
218
Member Avatar for strRusty_gal

Set all character set parameters to utf8. Query for "show variables like '%char%'" for a list. Set those variables in your my.cnf and set the correct character set for the connection in your application. Set also the database, table and field default character set to utf8.

Member Avatar for smantscheff
0
41
Member Avatar for srikanth2321

First of all, you have a bad table design. Column X should not exists except in a view. If you still stick to the design, the question is if the values in column X refer to another table. For the sake of the argument let's assume they refer to column …

Member Avatar for aquanetta
0
124
Member Avatar for stoopkid

Your solution lists only two of the the three possible status values. If you really don't care about the status you can just eliminate it from your query: [CODE]SELECT * FROM installs WHERE r1 = 'Standard' ORDER BY building, appointment_date ASC[/CODE]

Member Avatar for smantscheff
0
112
Member Avatar for cthoes

Either mysql is not running or your webserver is not configured properly to connect to it.

Member Avatar for smantscheff
0
49
Member Avatar for ppetree

[CODE]select * from test where name = 'Meals' or parent = (select id from test where name = 'Meals'); [/CODE]

Member Avatar for ppetree
0
150
Member Avatar for tatarao25
Member Avatar for smantscheff
0
96
Member Avatar for smantscheff

I just stumbled over this: [ICODE]mysql> select "abc" = 0; +-----------+ | "abc" = 0 | +-----------+ | 1 | +-----------+ 1 row in set, 1 warning (0.06 sec) mysql> show warnings; +---------+------+-----------------------------------------+ | Level | Code | Message | +---------+------+-----------------------------------------+ | Warning | 1292 | Truncated incorrect DOUBLE value: …

Member Avatar for pritaeas
0
313
Member Avatar for siaswar

Your mysql server is not running. I don't know about fedora, but in Ubuntu you start it as root with /etc/init.d/mysql start

Member Avatar for smantscheff
0
205
Member Avatar for AndreRet

You can delete all your mysql data by deleting the "data" directory in \xampp\mysql (at least that's the path in my installation). The access restrictions are stored in a database named mysql, so when you delete and re-install it you should be back on square 1. This has nothing to …

Member Avatar for WebStudio
0
2K
Member Avatar for extemer

The idea looks correct. Each class should have an ID and a name. The ID is the unique key. The class name should not be stored anywhere else than in the classes table, and refereoces to the class should contain the ID, not the name.

Member Avatar for extemer
0
93
Member Avatar for stephen_UK

MySQL does not have a URL field type which might handle the HTML formatting. You could write a MySQL function which replaces all URL-like text with HTML code. But it's easier done in PHP.

Member Avatar for stephen_UK
0
109
Member Avatar for siabenie

Probably you are using the wrong character set for the connection. Try it with command line mysql and have a look at the connection variables with [CODE] show variables like "%conn%" [/CODE]Set the connection character set to utf8.

Member Avatar for smantscheff
0
152
Member Avatar for Sahilsahni

Obviously there is a character set error. The data seem to be in UTF-8, while the browser announces them as another character set (maybe latin-1?) Check all relevant character set parameters: - database character set - table character set - field character set - connection character set - character set …

Member Avatar for smantscheff
0
154
Member Avatar for osm1987

I never found a way to do that. You can use a case statement which lists all the allowed table names and chooses the right one depending on a procedure input parameter, but I don't think that you can have truly dynamic table names in stored procedures or queries.

Member Avatar for debasisdas
0
122
Member Avatar for lifeworks

I deem it bad practice to do calculations in PHP which can be done on the database level. It is inefficient (because of the database in- and output) and it's error prone if the data are accessed through an other interface than PHP. Have a look at the time_diff function: …

Member Avatar for smantscheff
0
147
Member Avatar for Deathmachine

I never used this kind of constraint. For this purpose I'd rather use an enum field type for the class column.

Member Avatar for Deathmachine
0
168
Member Avatar for bluetoot

Get yourself a MySQL primer to read and study. If you have exactly one file per user, the administrative data for this file should go into the user_cv table, too. Otherwise - that is, if there may be more than one file per user - there has to be a …

Member Avatar for satyajit das
0
400
Member Avatar for bigfixcat

You can search for text fields containing non-printing characters with a regular expression: [CODE]select mytextfield from mytable where mytextfield rlike "[[:cntrl:]]" [/CODE] To search for non-ascii use the regexp "[^[:ascii:]]" For other character classes see here: [url]http://www.petefreitag.com/cheatsheets/regex/character-classes/[/url]

Member Avatar for smantscheff
0
39
Member Avatar for cobberas

Use an HTML table instead with one thumbnail image for each table cell.

Member Avatar for cobberas
0
1,000
Member Avatar for Righthe

No, this code is not correct. While [ICODE]0or[/ICODE] seems to be a typo, the insert syntax is wrong. The [ICODE]id[/ICODE] parameter is lacking a value.

Member Avatar for Righthe
0
186
Member Avatar for yamel115
Member Avatar for smantscheff
0
113
Member Avatar for bhob

This is the model. Adapt to your tables. [CODE]delete from grp_performance where g.id in ( SELECT g.id FROM grp_performance INNER JOIN category c ON g.cat_id = c.cat_id )[/CODE]

Member Avatar for Anuradha Mandal
0
115
Member Avatar for sherinpoulose

You can do it in a query which uses 3 left joins to connect from the highest to the lower levels of the hierarchy. But this is not a general solution as the hierarchy can - in principle - be arbitrarily deeply nested. Therefore you will need a prodedure to …

Member Avatar for debasisdas
0
172
Member Avatar for Gerbiler

It looks like the MySQL server and/or the TCP/IP connection on port 3306 do not work properly and have too long reponse times. How high is the average server load (as shown by "top")? If it is above 0.5 most of the time try to add ressources or to move …

Member Avatar for griswolf
0
540
Member Avatar for Zedith

Your brackets are wrong. Your sub-select returns the number 32, and the outer select cannot find any row with user_id = 1 and unique_id = 32. Try: [CODE]select * from blocks order by unique_id desc where user_id=1 limit 1; [/CODE]or [CODE]select * from blocks where user_id=1 and unique_id=(SELECT max(unique_id) from …

Member Avatar for Zedith
0
244
Member Avatar for arnapsui
Member Avatar for smantscheff
0
93
Member Avatar for DrunkMunki

For more complicated pattern match and replacement you could also dump the database to a file, run it through sed and import it again.

Member Avatar for DrunkMunki
0
368
Member Avatar for 54uydf

You have to escape the apostrophe with a backslash. In PHP there is the function mysql_real_escape_string with adds all the necessary backslashes for feeding text into mysql. The query must read: [CODE]INSERT INTO tbl (Id, courseName) VALUES(123,'Apostroph'd name'); [/CODE]In PHP you have to make sure that the escape character itself …

Member Avatar for 54uydf
0
121
Member Avatar for Arthi Raman

// Use the mysql week() or weekofyear() functions. No, you cannot retrieve all week numbers between dates in one query without a stored function or procedure. What you would need is a function which returns a result set of more than one row with two input parameters for the limiting …

Member Avatar for Arthi Raman
0
139
Member Avatar for ppetree

Where you compare a value or a column with the result of a subselect this subselect must have the same number of columns as those which you are comparing - one, as a rule. So you cannot use the * operator in your subselect. Apart from that your WHERE clause …

Member Avatar for ppetree
0
120
Member Avatar for tatarao25

This looks like rubbish. How do you join table9 with a link from table6 to table1? Why don't you post code which you have actually tried? Submit a test case, complete with table structures, test data and the actual code which you are trying to implement.

Member Avatar for tatarao25
0
173
Member Avatar for fatemeG

You could use a flat file database like SQLite. But I doubt that you will be happy with it.

Member Avatar for smantscheff
0
58
Member Avatar for MargateSteve

Which parameter value have you set for season_id ? How and where do you set an initial value for rank (@rownum)? This query code works for me (i.e. it delivers results which seem to be structurally o.k.): [CODE]set @rownum = 0; SELECT *, t.team_name as Tm , @rownum := @rownum+1 …

Member Avatar for urtrivedi
0
199
Member Avatar for Fibinacci85

Hire a programmer. If you need a mysql forum to find an image management software you should definitely not try it yourself, except you got time to burn.

Member Avatar for iamthwee
-1
124
Member Avatar for sagive
Member Avatar for LeeMan4
Member Avatar for smantscheff
0
37
Member Avatar for jkon

[CODE]select distinct person_id from persons_records where person_id in (select person_id from persons_records where record_id=1) and person_id in (select person_id from persons_records where record_id=2); [/CODE] or, this being mySQL: [CODE]select person_id, group_concat(record_id) as r from persons_records having locate(1,r) and locate(2,r) [/CODE] But your code is fine, though.

Member Avatar for diafol
0
147
Member Avatar for capiuy

If you really want to achieve this kind of translation you need a higher level representation of the statements to be translated. On which level does the PHP "for" statement match the JAVA "if" statement and vice versa? If it does, it will be on the level of program flow …

Member Avatar for smantscheff
0
278
Member Avatar for qurawe
Member Avatar for smantscheff
0
184
Member Avatar for rEhSi_123

Reqular expressions with variable thread and forum ids are: [url]http://www\.daniweb\.com/web-development/databases/mysql/threads/[/url][0-9]+ [url]http://www\.daniweb\.com/web-development/databases/mysql/[/url][0-9]+

Member Avatar for rEhSi_123
0
1K
Member Avatar for extemer

There is no such thing as a general database template. A database is a means to organize content, and its structure depends on the semantics of the content.

Member Avatar for debasisdas
0
105

The End.