802 Posted Topics

Member Avatar for TonyG_cyprus

I have no clear idea of what you are trying, but this here is definitively wrong: [CODE]$z=mysql_query("UPDATE levels SET bal=bal-'$new[$i]' WHERE itemsize= '$item[$i]'"); $result=mysql_query($z);[/CODE] The result of the mysql_query function is a ressource identifier which you cannot use as input for the same function.

Member Avatar for urtrivedi
0
165
Member Avatar for basketmen

Show the output of [ICODE]SHOW CREATE TABLE account[/ICODE]. This table has a unique index on three fields which seems to be semantically wrong.

Member Avatar for smantscheff
0
111
Member Avatar for bikashdas
Member Avatar for smantscheff
0
193
Member Avatar for tanha

Grant access to the UDF to all involved parties and call it with the database name as a dot-terminated prefix, like in [CODE] call testDB.myUDF(); [/CODE]

Member Avatar for smantscheff
0
148
Member Avatar for jshenn

First of all, this looks like bad table design. A table with similar columns most probably should be split in at least two tables. Second, you don't tell where your problem is. To count non-zero column values in a stored procedure or function this function will have to contain an …

Member Avatar for smantscheff
0
278
Member Avatar for Smeagel13

It is a matter of interpretation of your application if an exercise is cardio or strength, but not an explicit datum. Therefore I'd rather have only one table for all attributes of the cardio and strength tables and compute from the actual data if a row is a cardio or …

Member Avatar for smantscheff
0
136
Member Avatar for godwinaka4life

Hire a programmer. Or come back if you have some code which doesn't work.

Member Avatar for simplypixie
0
91
Member Avatar for tatarao25
Member Avatar for strongpot

mysql_insert_id is an integer. You cannot have database, table or field names beginning with numerals. Prefix the table name with some literal constant.

Member Avatar for smantscheff
0
246
Member Avatar for riya_developer

You can prefix the table name with the (dot-terminated) database name in queries, thus allowing for joins across database limits. To the beste of my knowledge, you cannot create foreign keys, though, which are maintained by InnoDB.

Member Avatar for urtrivedi
0
244
Member Avatar for solomon_13000

Do not convert NOW() and terminationDate into strings for date arithmetics and comparisons.

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

[CODE]select greatest(t1.chan1,t1.chan2,t1.chan3), captureTime from myTable t1 where greatest(t1.chan1,t1.chan2,t1.chan3) = ( select max(greatest(t2.chan1, t2.chan2, t2.chan3)) from myTable t2 group by substr(t2.captureTime, 1, 15) ) and substr(t1.captureTime, 1, 15 ) = substr( t2.captureTime, 1, 15) [/CODE] Lots of query optimization needed, I presume.

Member Avatar for smantscheff
0
207
Member Avatar for pro_learner

Use the commandline client. That way you know exactly what you're doing, and you can easily script and replicate your whole database setup. Pay attention to the various character encoding settings.

Member Avatar for smantscheff
0
137
Member Avatar for gikonyo

Show the query and the table structure. And learn some CSS and how to avoid redundant coding.

Member Avatar for smantscheff
0
104
Member Avatar for microbert

Show the code. Probably you are omitting some quotation marks.

Member Avatar for smantscheff
0
165
Member Avatar for Baxtula

All needed information is in the inventory table. There is no need for monthly tables as you can filter data by their timestamps. To avoid checking of double entries you could define a month's inventory as all entries with a timestamp from the this or following month (depending on the …

Member Avatar for Baxtula
0
299
Member Avatar for gikonyo
Member Avatar for gikonyo
0
298
Member Avatar for veledrom

Your 4 (count them: four) user inputs can be tested for duplicate combinations just by one query: [CODE]select * from mytable where name = <name> or surname = <surname> or DoB = <dob> or Nationality = <nationality>[/CODE] If you want to test for combinations with at least two factors, use …

Member Avatar for smantscheff
0
130
Member Avatar for gikonyo

1) Define order_no as an auto_increment field. 2) Enter [ICODE] ALTER TABLE mytable AUTO_INCREMENT = 70000; [/ICODE] at the mysql command prompt.

Member Avatar for smantscheff
0
75
Member Avatar for 9tontruck

Make sure that all your databases, tables and connections use utf-8 as a character set. Enter [ICODE]show variables like "character_set%"[/ICODE] at the mysql command prompt to make sure that you did it right. Make sure that also the HTML output contains UTF-8 and that the Content-type header looks like [ICODE]Content-type: …

Member Avatar for smantscheff
0
88
Member Avatar for RicardoE

It depends on your data definition. If you defined the zip codes as integers you cannot have leading zeros. You will have to add them in processing the data. If you defined the zip codes as character fields you can use the implicit conversion or the convert function: [CODE]update mytable …

Member Avatar for smantscheff
0
144
Member Avatar for Pragati.rch

As long as you do not post a concrete question pertaining to mysql you probably won't get an answer. If you rather do your processing in PHP or in the database is a matter of taste, speed and efficiency. I recommend that all processing which can be moved to the …

Member Avatar for smantscheff
0
318
Member Avatar for BenCraven

Your problem is not clear. What is the value of the Weblink field and what would you like to display in the browser?

Member Avatar for smantscheff
0
126
Member Avatar for newbie14

That is what transactions are for. Bracket your check and insert procedure in a transaction which you can roll back in case of duplicate values.

Member Avatar for newbie14
0
264
Member Avatar for apatuka
Member Avatar for smantscheff
0
2K
Member Avatar for shanker31

What exactly is your problem? Go ahead and code a procedure. Come back if it does not work and show us what you did.

Member Avatar for smantscheff
0
172
Member Avatar for Tunnleram

I don't know what you're missing, but I am missing the table structure and some test data. Are there NULL values in the Kills and Deaths columns?

Member Avatar for k1robert
0
281
Member Avatar for fahien

If you use 32-bit integers for the contact ID field you may store up to 2^32-1 different contacts. That should be sufficient for all practical purposes.

Member Avatar for fahien
0
177
Member Avatar for rajandass65

It's a bad idea because you will be duplicating data structures. In development you will have to replicate any database design change in all databases. It's much easier to develop in only one language and to add translations either by means of additional content fields or by means of one …

Member Avatar for smantscheff
0
81
Member Avatar for morrisproject

Design your database first, then the interface. If the asset type depends on the conveyor number and there is a limited number of asset types, you have a 1:n relation from asset types to conveyors, which in proper database design is expressed as a table Assets (id, asset_type) and a …

Member Avatar for smantscheff
0
121
Member Avatar for bangla

When I test your code, the line [CODE]insert into hh values(27.22); [/CODE]results in the mysql error[ICODE] 1264: Out of range error for column id[/ICODE] You have to define the double field with as much decimal places as needed. Change the table definition to [CODE]create table hh (id double(5,2)); [/CODE]and it …

Member Avatar for smantscheff
0
72
Member Avatar for morrisproject

Which queries do you need to adjust? In which queries do you refer explicitly to the primary key?

Member Avatar for smantscheff
0
172
Member Avatar for Joemeister

This looks like nonsense. When you want to delete a record from the post table you have to know it's post_id. You do not need an arbitrary generated value in the user table for that purpose.

Member Avatar for smantscheff
0
785
Member Avatar for thetwig

Your PHP is compiled without mysql support. Create a php file with this content: [CODE]<?php phpinfo(); [/CODE]and navigate your browser to that file. It will tell you which PHP modules are installed and active.

Member Avatar for smantscheff
0
254
Member Avatar for mangel.murti

Looks like a 1:n relation from Broker to Agent, which means that the Agent table needs a foreign key (broker_id) into the Broker table. Further you need a 1:n relation from Agents to Leads. And maybe one from Brokers to Leads (depends on the semantics of your app).

Member Avatar for smantscheff
0
72
Member Avatar for fairy1992224

Seems quite o.k. You should not store unencrypted plain text passwords for security reasons. And instead of "SELECT *" better "SELECT username,password" for performance reasons.

Member Avatar for fairy1992224
0
262
Member Avatar for MDanz

You could use a unique index on the unique field combination an then use "INSERT IGNORE" without a prior check for doublettes.

Member Avatar for smantscheff
0
89
Member Avatar for mitchiexlolz

You seem to be using mysql as a database, not mysqlbuddy. mysqlbuddy is just an interface to the database, as is phpmyadmin, too. It does not matter to the website application which of those you use. I recommend HeidiSQL. Are you sure that you want to store plaintext passwords? That …

Member Avatar for smantscheff
0
175
Member Avatar for 54uydf

What is the output of [CODE]SHOW CREATE TABLE `table 1`; SHOW CREATE TABLE `table 2`; SHOW CREATE TABLE `table 3`; [/CODE]?

Member Avatar for smantscheff
0
143
Member Avatar for MargateSteve

This structure of games depending on the outcome of previous games is effectively a recursive hierarchy or tree structure. This cannot be properly displayed in plain queries or views. You will need a function which computes for a given match recursively the outcomes of all previous matches to determine the …

Member Avatar for smantscheff
0
112
Member Avatar for liphoso

Google for "mysql replication" or "mysql master slave". If that functionality is not sufficient then code your own database abstraction layer in PHP so that each query which is not a SELECT statement is mirrored on a separate connection to the 2nd server.

Member Avatar for fobos
0
110
Member Avatar for Kaskito

It seems that any stage belongs to a place, but not any place has more than one stages. Therefore I would set up a database in which - each concert takes place at a time and a place; - each place may have several stages; - each stage belongs to …

Member Avatar for smantscheff
0
621
Member Avatar for rushi3311

Show the output of SHOW CREATE TABLE for all involved tables (preferably as text, not as a screenshot).

Member Avatar for smantscheff
0
264
Member Avatar for dangari

Your table and/or index file(s) are corrupt. Restore them from a backup or try to repair them. Have a look at [url]http://dev.mysql.com/doc/refman/5.0/en/myisam-repair.html[/url]

Member Avatar for mickjsn
0
297
Member Avatar for roottybrian

I tried your code (with the table and some field names changed) and it does not generate an error in my test. [CODE]DELIMITER // CREATE TRIGGER confirmation_triggers AFTER INSERT ON `bielefeld` FOR EACH ROW IF new.institution='True' THEN INSERT INTO `notifications` VALUES(NULL, new.institution, "Notification here", CURDATE()); END IF; END; DELIMITER //[/CODE]

Member Avatar for rch1231
0
137
Member Avatar for newbie14

Along those lines: [CODE]SELECT productID,totalAmountAfter,transactionDate FROM tbltransaction WHERE transactionDate BETWEEN '2010-01-01' AND '2010-12-31' and (productID, transactionDate) in (SELECT productID, max(transactionDate) from tbltransaction group by productID) ORDER BY productID,transactionDate DESC [/CODE]

Member Avatar for smantscheff
0
107
Member Avatar for girl9907

You are trying to insert a child record for which no entry exists in the parent table.

Member Avatar for smantscheff
0
48
Member Avatar for gedas

What have you tried so far? Have a look at the to_days() and the round() function which may help to solve your problem.

Member Avatar for smantscheff
0
76
Member Avatar for Agentsmith

You say that the level cannot expressed by a mathematical function, but it can be expressed by a function using the TRUNCATE() and CEILING() functions. So you can define level as a user defined function of score and use it in views and queries.

Member Avatar for smantscheff
0
210
Member Avatar for prem2

EXPLAIN doesn't tell you anything about execution time but only about query optimization. [QUOTE]Then there should be no difference.[/QUOTE] Why not? A binary comparison does not need any conversion before the comparison, while a non-binary string comparison requires some operations for case matching. Therefore a non-binary comparison should need more …

Member Avatar for iw2011
0
172

The End.