473,756 Members | 6,970 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql update/replace syntax

To keep track of how many fruits my visitors buy, I use a mySQL database
(2 columns: "fruit" and "quantity").... so can we make these following
mySQL queries work somehow?

(visitor buys 5 apples):
replace into fruit_database set fruit = 'apple' , quantity = quantity +
5;

(visitor buys 7 apples):
replace into fruit_database set fruit = 'apple' , quantity = quantity +
7;

(visitor buys 1 grape):
replace into fruit_database set fruit = 'grape' , quantity = quantity +
1

Thanks!

Jul 17 '05
19 8701
On Sun, 29 Aug 2004 14:18:05 +0000, Westcoast Sheri wrote:
CJ Llewellyn wrote:
"Westcoast Sheri" <sh*********@no spamun8nospam.c om> wrote in message
news:41******** *******@nospamu n8nospam.com...
> CJ Llewellyn wrote:
>
> > "Westcoast Sheri" <sh*********@no spamun8nospam.c om> wrote in message
> > news:41******** *******@nospamu n8nospam.com...
> > > To keep track of how many fruits my visitors buy, I use a mySQL

database
> > > (2 columns: "fruit" and "quantity").... so can we make these following
> > > mySQL queries work somehow?
> > >
> > > (visitor buys 5 apples):
> > > replace into fruit_database set fruit = 'apple' , quantity = quantity

+
> > > 5;
> > >
> > > (visitor buys 7 apples):
> > > replace into fruit_database set fruit = 'apple' , quantity = quantity

+
> > > 7;
> > >
> > > (visitor buys 1 grape):
> > > replace into fruit_database set fruit = 'grape' , quantity = quantity

+
> > > 1
> >
> > You are approching this from the wrong angle. You should be quering the
> > customer sales records and producing summary information from that.
> >
> > INSERT INTO sales (customer, product , qty) VALUES
> > ('$customer','$ fruit','$qty')
> >
> > SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
> > numsales
> >
> > http://dev.mysql.com/doc/mysql/en/GR...Functions.html
>
> No, I am wanting to *record* what visitor does. If they buy 5 apples, I

want
> mySQL to find the row with "apple" in it, and increment it by 5. If there

is
> *no* row with "apple", then create a row and enter a "5" there.


Yes you are. The above will tell you exactly how many apples or bananas have
been sold without resorting to increamenting a seperate table/record.

Further more, with a little creativity, you can find out things like, on
what day which fruit sells best. How much of each fruit do you sell each
month? Is there a peek period for selling oranges?


no no no. If visitor "a" buys 5 apples, then a "5" should be in the mySQL
table. But then, an hour later, if visitor "b" buys 3 more apples, then an "8"
should be in the mySQL table. What you are suggesting is that first there will
be a "5" in the table....then when visitor "b" buys 3 apples, there will then
be a "3" in the table. I really thought I worded my question very well.
Apparantly not. Sorry.


You question was understood. It's just your approach to the problem is
wrong.

If you have a table that holds

Apple 5
Orange 6
Banana 567

This will not tell you a lot. Only in total how much of each fruit you've
sold. Unless you reset the values every week, you'll not be able to spot
trends in people's buying thus purchasing more stock than is needed.

You have a table holding

Fred Smith 1/1/04 Apple 2
Fred Smith 1/1/04 Banana 3
John Jones 2/1/04 Apple 5

You can tell how many apples and bananas have been sold, by summing them
up.
Jul 17 '05 #11
CJ Llewellyn wrote:
On Sun, 29 Aug 2004 14:18:05 +0000, Westcoast Sheri wrote:
CJ Llewellyn wrote:
"Westcoast Sheri" <sh*********@no spamun8nospam.c om> wrote in message
news:41******** *******@nospamu n8nospam.com...
> CJ Llewellyn wrote:
>
> > "Westcoast Sheri" <sh*********@no spamun8nospam.c om> wrote in message
> > news:41******** *******@nospamu n8nospam.com...
> > > To keep track of how many fruits my visitors buy, I use a mySQL
database
> > > (2 columns: "fruit" and "quantity").... so can we make these following
> > > mySQL queries work somehow?
> > >
> > > (visitor buys 5 apples):
> > > replace into fruit_database set fruit = 'apple' , quantity = quantity
+
> > > 5;
> > >
> > > (visitor buys 7 apples):
> > > replace into fruit_database set fruit = 'apple' , quantity = quantity
+
> > > 7;
> > >
> > > (visitor buys 1 grape):
> > > replace into fruit_database set fruit = 'grape' , quantity = quantity
+
> > > 1
> >
> > You are approching this from the wrong angle. You should be quering the
> > customer sales records and producing summary information from that.
> >
> > INSERT INTO sales (customer, product , qty) VALUES
> > ('$customer','$ fruit','$qty')
> >
> > SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
> > numsales
> >
> > http://dev.mysql.com/doc/mysql/en/GR...Functions.html
>
> No, I am wanting to *record* what visitor does. If they buy 5 apples, I
want
> mySQL to find the row with "apple" in it, and increment it by 5. If there
is
> *no* row with "apple", then create a row and enter a "5" there.

Yes you are. The above will tell you exactly how many apples or bananas have
been sold without resorting to increamenting a seperate table/record.

Further more, with a little creativity, you can find out things like, on
what day which fruit sells best. How much of each fruit do you sell each
month? Is there a peek period for selling oranges?


no no no. If visitor "a" buys 5 apples, then a "5" should be in the mySQL
table. But then, an hour later, if visitor "b" buys 3 more apples, then an "8"
should be in the mySQL table. What you are suggesting is that first there will
be a "5" in the table....then when visitor "b" buys 3 apples, there will then
be a "3" in the table. I really thought I worded my question very well.
Apparantly not. Sorry.


You question was understood. It's just your approach to the problem is
wrong.

If you have a table that holds

Apple 5
Orange 6
Banana 567

This will not tell you a lot. Only in total how much of each fruit you've
sold. Unless you reset the values every week, you'll not be able to spot
trends in people's buying thus purchasing more stock than is needed.

You have a table holding

Fred Smith 1/1/04 Apple 2
Fred Smith 1/1/04 Banana 3
John Jones 2/1/04 Apple 5

You can tell how many apples and bananas have been sold, by summing them
up.


Okay...I see you are putting a spin on things...and it is quite interesting. I
think you are saying, "ya you have an idea...but this one is better," and I think I
may agree. It is quite easy for me to create php code to make the "fred smith"
example table... but the question, now, is How do I do a "SUM" select statement
(e.g. something like "select SUM (quantity) from fruit_table where fruit = 'apple'"
or something like that?
Jul 17 '05 #12
Andy Hassall wrote:
On Sun, 29 Aug 2004 14:21:50 GMT, Westcoast Sheri
<sh*********@no spamun8nospam.c om> wrote:
Andy Hassall wrote:
On Sun, 29 Aug 2004 12:14:44 GMT, Westcoast Sheri
<sh*********@no spamun8nospam.c om> wrote:

> You are approching this from the wrong angle. You should be quering the
> customer sales records and producing summary information from that.
>
> INSERT INTO sales (customer, product , qty) VALUES
> ('$customer','$ fruit','$qty')
>
> SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
> numsales
>
> http://dev.mysql.com/doc/mysql/en/GR...Functions.html

No, I am wanting to *record* what visitor does. If they buy 5 apples, I want
mySQL to find the row with "apple" in it, and increment it by 5. If there is
*no* row with "apple", then create a row and enter a "5" there.

If a customer buys 5 apples, then a week later buys 3 apples, you've still
only got one row. Since you haven't given an indication that there's any table
recording each sale, that's what's raising concerns about your design.

If you really do want to do it like this, then:

(1) Lock the SALES table.
(2) Attempt an update, setting quantity = quantity + $n.
(3) Check mysql_affected_ rows(). If zero, do an insert instead.
(4) Unlock the SALES table.

The locking is necessary because other sessions might do the same operation,
causing a classic race condition leading to either a key violation or a lost
update.

Since you're trying to ensure the non-existence of a row, you can't row-level
lock a non-existent row, so you have to table lock, meaning this operation is
always serialised.

With the one-row-per-sale and then a SUM to derive the totals, these issues
don't arise.


when you say, "a SUM to derive the totals..." you mean to do the steps 1 thru 4
that you outlined above, right?


No, I was agreeing with CJ Llewellyn's suggestion above. The steps 1-4 are how
to implement your current design and original question where there is only a
running total of quantity in the table.
If so, I can [figure out how to] do that.
However, it looks like you might have suggested the step 1-4 thingy, and then
followed up by saying it is better to do something different (like each sale has
own line...e.g. apples = 4, apples = 7, apples = 9, and then using a PHP query to
select all rows w/ apples and add em up). right?


Yes, that's right.


Okay, I guess I'll pour over the literature to find how to select a "sum".... unless
of course, you would please type the line of code :-)

Jul 17 '05 #13
On Sun, 29 Aug 2004 22:30:34 GMT, Westcoast Sheri
<sh*********@no spamun8nospam.c om> wrote:
Okay, I guess I'll pour over the literature to find how to select a "sum".... unless
of course, you would please type the line of code :-)


CJ already posted it several messages back.

--
Andy Hassall / <an**@andyh.co. uk> / <http://www.andyh.co.uk >
<http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #14
Westcoast Sheri wrote:
CJ Llewellyn wrote:

On Sun, 29 Aug 2004 14:18:05 +0000, Westcoast Sheri wrote:

CJ Llewellyn wrote:
"Westcoas t Sheri" <sh*********@no spamun8nospam.c om> wrote in message
news:41**** ***********@nos pamun8nospam.co m...

>CJ Llewellyn wrote:
>
>
>>"Westcoas t Sheri" <sh*********@no spamun8nospam.c om> wrote in message
>>news:41** *************@n ospamun8nospam. com...
>>
>>>To keep track of how many fruits my visitors buy, I use a mySQL

database

>>>(2 columns: "fruit" and "quantity").... so can we make these following
>>>mySQL queries work somehow?
>>>
>>>(visit or buys 5 apples):
>>>replac e into fruit_database set fruit = 'apple' , quantity = quantity

+

>>>5;
>>>
>>>(visit or buys 7 apples):
>>>replac e into fruit_database set fruit = 'apple' , quantity = quantity

+

>>>7;
>>>
>>>(visit or buys 1 grape):
>>>replac e into fruit_database set fruit = 'grape' , quantity = quantity

+

>>>1
>>
>>You are approching this from the wrong angle. You should be quering the
>>custome r sales records and producing summary information from that.
>>
>>INSERT INTO sales (customer, product , qty) VALUES
>>('$custom er','$fruit','$ qty')
>>
>>SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
>>numsale s
>>
>>http://dev.mysql.com/doc/mysql/en/GR...Functions.html
>
>No, I am wanting to *record* what visitor does. If they buy 5 apples, I

want

>mySQL to find the row with "apple" in it, and increment it by 5. If there

is

>*no* row with "apple", then create a row and enter a "5" there.

Yes you are. The above will tell you exactly how many apples or bananas have
been sold without resorting to increamenting a seperate table/record.

Further more, with a little creativity, you can find out things like, on
what day which fruit sells best. How much of each fruit do you sell each
month? Is there a peek period for selling oranges?

no no no. If visitor "a" buys 5 apples, then a "5" should be in the mySQL
table. But then, an hour later, if visitor "b" buys 3 more apples, then an "8"
should be in the mySQL table. What you are suggesting is that first there will
be a "5" in the table....then when visitor "b" buys 3 apples, there will then
be a "3" in the table. I really thought I worded my question very well.
Apparantly not. Sorry.


You question was understood. It's just your approach to the problem is
wrong.

If you have a table that holds

Apple 5
Orange 6
Banana 567

This will not tell you a lot. Only in total how much of each fruit you've
sold. Unless you reset the values every week, you'll not be able to spot
trends in people's buying thus purchasing more stock than is needed.

You have a table holding

Fred Smith 1/1/04 Apple 2
Fred Smith 1/1/04 Banana 3
John Jones 2/1/04 Apple 5

You can tell how many apples and bananas have been sold, by summing them
up.

Okay...I see you are putting a spin on things...and it is quite interesting. I
think you are saying, "ya you have an idea...but this one is better," and I think I
may agree. It is quite easy for me to create php code to make the "fred smith"
example table... but the question, now, is How do I do a "SUM" select statement
(e.g. something like "select SUM (quantity) from fruit_table where fruit = 'apple'"
or something like that?


Wc Sheri,

As I stated in the previous thread, you need to have a better understanding of
database design BEFORE you write lots code and create databases that are of
little value outside of storing the data. Storing it is of no use unless you
can derive information from it "easily".

I certainly hope you are not creating a new table for EACH customer as seems to
be inferred by the statement "It is quite easy for me to create php code to make
the "fred smith" example table... ".

Create ONE table

Customer_ID (auto increment), txdate, Last_name, First_name, Item, Qty, Total

then in your PHP code

insert into customer values (nextval, date(), 'Thomas', 'Fred', 'Apple', 5, 2.30);

etc...

Now to find out what happened today:

select item,sum(qty),s um(total) from customer where item = 'Apple'
where txdate = date('somedates tring') group by item, qty, total;

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #15
>> > You are approching this from the wrong angle. You should be quering the
> customer sales records and producing summary information from that.
This is a hospital kitchen. Recording Personally Identifiable
Information about a patient in a database makes that database legally
unusable for the purpose intended for it (what kind of food they
should order and how much they should keep on hand), and that's why
your predecessor is in jail now: violating HIPAA requirements.
> INSERT INTO sales (customer, product , qty) VALUES
> ('$customer','$ fruit','$qty')
>
> SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
> numsales
>
> http://dev.mysql.com/doc/mysql/en/GR...Functions.html
No, I am wanting to *record* what visitor does. If they buy 5 apples, I

want
mySQL to find the row with "apple" in it, and increment it by 5. If there

is
*no* row with "apple", then create a row and enter a "5" there.


It is possible to insert or update a row with one query:

INSERT INTO sales_summary SET product = 'apple', qty = 3
ON DUPLICATE KEY UPDATE qty = qty + 3;

This requires that the product column has a unique key on it.

It has the advantage that it's atomic: you don't have to do explicit
locking but you can't get fouled up by different ordering of requests.
(The problem with this kind of query is that you need a minimum
version of MySQL of about 4.1 (not sure exactly which version), and
I don't know that any other database accepts this syntax.).

You might be able to add a "date" column to get daily totals, but
only if you can convince management that asking the judge for
permission is worth the risk of having him prohibit the existence
of the database entirely.

I use this sort of thing a lot with email white/black lists. You
want to record, say, the sender, the number of emails from this
sender to good addresses (but NOT what the good addresses are), the
number of emails from this sender to bad addresses (but NOT what
the bad addresses are), and the time of the latest email from that
sender. If there's no entry, add one. If there is an entry,
increment one of the counters. There is a high probability of
simultaneous SPAMs from the same sender arriving at the same time.
You DO NOT want to record each email: this allows spammers to
conduct a denial-of-service attack against you by running your
database out of disk space.

Another process can later classify the sender as one to be blocked
or not, in part based on the assumption that a sender who sends
a lot of mail to mostly invalid addresses is a spammer. Other
fields can store manual settings.
Yes you are. The above will tell you exactly how many apples or bananas have
been sold without resorting to increamenting a seperate table/record.
Yes, but you use a lot more storage, and the personally identifiable
information in it means you're not allowed to do any SELECTs at
all, and has a high probability of getting the whole project cancelled.
Further more, with a little creativity, you can find out things like, on
what day which fruit sells best. How much of each fruit do you sell each
month? Is there a peek period for selling oranges?


Keeping this kind of marketing information around can kill your business
if it gets out that you're keeping it, say, because someone managed
to steal it.

Gordon L. Burditt
Jul 17 '05 #16
"Gordon Burditt" <go***********@ burditt.org> wrote in message
news:cg******** @library1.airne ws.net...
> You are approching this from the wrong angle. You should be quering the > customer sales records and producing summary information from that.

This is a hospital kitchen. Recording Personally Identifiable
Information about a patient in a database makes that database legally
unusable for the purpose intended for it (what kind of food they
should order and how much they should keep on hand), and that's why
your predecessor is in jail now: violating HIPAA requirements.

-snip-

Nobody has said that this is a hospital kitchen. HIPAA requirements do not
apply outside of the USA. HIPAA only applies to hospital information.
Nothing in the example mandates that personal information is to be kept.
Keeping this kind of marketing information around can kill your business
if it gets out that you're keeping it, say, because someone managed
to steal it.


Every single in the company in the world keeps this type of information.
They have to, otherwise they have great difficulty in managing their
accounts, stock order processes, producing statutory information i.e. tax
returns and providing good customer service.


Jul 17 '05 #17
Michael Austin wrote:
Westcoast Sheri wrote:
CJ Llewellyn wrote:

On Sun, 29 Aug 2004 14:18:05 +0000, Westcoast Sheri wrote:
CJ Llewellyn wrote:
>"Westcoas t Sheri" <sh*********@no spamun8nospam.c om> wrote in message
>news:41**** ***********@nos pamun8nospam.co m...
>
>>CJ Llewellyn wrote:
>>
>>
>>>"Westcoas t Sheri" <sh*********@no spamun8nospam.c om> wrote in message
>>>news:41** *************@n ospamun8nospam. com...
>>>
>>>>To keep track of how many fruits my visitors buy, I use a mySQL
>
>database
>
>>>>(2 columns: "fruit" and "quantity").... so can we make these following
>>>>mySQL queries work somehow?
>>>>
>>>>(visit or buys 5 apples):
>>>>replac e into fruit_database set fruit = 'apple' , quantity = quantity
>
>+
>
>>>>5;
>>>>
>>>>(visit or buys 7 apples):
>>>>replac e into fruit_database set fruit = 'apple' , quantity = quantity
>
>+
>
>>>>7;
>>>>
>>>>(visit or buys 1 grape):
>>>>replac e into fruit_database set fruit = 'grape' , quantity = quantity
>
>+
>
>>>>1
>>>
>>>You are approching this from the wrong angle. You should be quering the
>>>custome r sales records and producing summary information from that.
>>>
>>>INSERT INTO sales (customer, product , qty) VALUES
>>>('$custom er','$fruit','$ qty')
>>>
>>>SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
>>>numsale s
>>>
>>>http://dev.mysql.com/doc/mysql/en/GR...Functions.html
>>
>>No, I am wanting to *record* what visitor does. If they buy 5 apples, I
>
>want
>
>>mySQL to find the row with "apple" in it, and increment it by 5. If there
>
>is
>
>>*no* row with "apple", then create a row and enter a "5" there.
>
>Yes you are. The above will tell you exactly how many apples or bananas have
>been sold without resorting to increamenting a seperate table/record.
>
>Further more, with a little creativity, you can find out things like, on
>what day which fruit sells best. How much of each fruit do you sell each
>month? Is there a peek period for selling oranges?

no no no. If visitor "a" buys 5 apples, then a "5" should be in the mySQL
table. But then, an hour later, if visitor "b" buys 3 more apples, then an "8"
should be in the mySQL table. What you are suggesting is that first there will
be a "5" in the table....then when visitor "b" buys 3 apples, there will then
be a "3" in the table. I really thought I worded my question very well.
Apparantly not. Sorry.

You question was understood. It's just your approach to the problem is
wrong.

If you have a table that holds

Apple 5
Orange 6
Banana 567

This will not tell you a lot. Only in total how much of each fruit you've
sold. Unless you reset the values every week, you'll not be able to spot
trends in people's buying thus purchasing more stock than is needed.

You have a table holding

Fred Smith 1/1/04 Apple 2
Fred Smith 1/1/04 Banana 3
John Jones 2/1/04 Apple 5

You can tell how many apples and bananas have been sold, by summing them
up.

Okay...I see you are putting a spin on things...and it is quite interesting. I
think you are saying, "ya you have an idea...but this one is better," and I think I
may agree. It is quite easy for me to create php code to make the "fred smith"
example table... but the question, now, is How do I do a "SUM" select statement
(e.g. something like "select SUM (quantity) from fruit_table where fruit = 'apple'"
or something like that?


Wc Sheri,

As I stated in the previous thread, you need to have a better understanding of
database design BEFORE you write lots code and create databases that are of
little value outside of storing the data. Storing it is of no use unless you
can derive information from it "easily".

I certainly hope you are not creating a new table for EACH customer as seems to
be inferred by the statement "It is quite easy for me to create php code to make
the "fred smith" example table... ".

Create ONE table

Customer_ID (auto increment), txdate, Last_name, First_name, Item, Qty, Total

then in your PHP code

insert into customer values (nextval, date(), 'Thomas', 'Fred', 'Apple', 5, 2.30);

etc...

Now to find out what happened today:

select item,sum(qty),s um(total) from customer where item = 'Apple'
where txdate = date('somedates tring') group by item, qty, total;


Thank you for the code. I was actually creating a separate table for not only each
customer, but each value.
....(...just kidding, I just have one table :-)

Jul 17 '05 #18
Gordon Burditt wrote:
> You are approching this from the wrong angle. You should be quering the
> customer sales records and producing summary information from that.
This is a hospital kitchen. Recording Personally Identifiable
Information about a patient in a database makes that database legally
unusable for the purpose intended for it (what kind of food they
should order and how much they should keep on hand), and that's why
your predecessor is in jail now: violating HIPAA requirements.
INSERT INTO sales (customer, product , qty) VALUES
> ('$customer','$ fruit','$qty')
>
> SELECT fruit, sum(qty) AS numsales FROM sales GROUP BY fruit ORDER BY
> numsales
>
> http://dev.mysql.com/doc/mysql/en/GR...Functions.html

No, I am wanting to *record* what visitor does. If they buy 5 apples, I

want
mySQL to find the row with "apple" in it, and increment it by 5. If there

is
*no* row with "apple", then create a row and enter a "5" there.


It is possible to insert or update a row with one query:

INSERT INTO sales_summary SET product = 'apple', qty = 3
ON DUPLICATE KEY UPDATE qty = qty + 3;


.....actually this is the first code I ever tried (because it's exactly what I
wanted in the first place!), and kept getting errors! But then I realized that
perhaps my server was not using the mySQL version that allowed this ("...blah
blah blah syntax error near "ON DUPLICATE KEY"). That is the perfect line of
code, though! Thanks!!!


Jul 17 '05 #19
ercherry
1 New Member
I had the exact same problem as the original poster, and I didn't want all of the excess data that was suggested as imperative for collection by the responders. My problem was increased by the fact that I couldn't use that ON DUPLICATE KEY UPDATE line of code due to lack of support. (SO SAD)

So here is what I did...

$query="SELECT c FROM Table WHERE a= "somevalue" ;
$result =mysql_query($q uery)OR die("error 3 - query failed".mysql_e rror());
$myrow = mysql_fetch_arr ay($result);
$3val = $myrow["c"];
++$3val;

$query = "REPLACE INTO Table (a, b, c) VALUES ($aval, $2val, $3val)";
$result =mysql_query($q uery)OR die("error 3 - query failed".mysql_e rror());

....

I tried to simplify it a bit for reading here...

I'm trying to increment a value before it gets replaced. The above works, but strangely, the $3val gets incremented twice.

It could be happening somewhere else in the code, because I am using Flash remoting. It's a crazy little bug to track down, but I have a feeling that it is the REPLACE command that is doing it to me. I'm at a loss.

I also tried stripping the

++$3val;

and instead putting it directly into the query

$query = "REPLACE INTO Table (a, b, c) VALUES ($aval, $2val, ($3val + 1))";
$result =mysql_query($q uery)OR die("error 3 - query failed".mysql_e rror());
May 1 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1539
by: Angelos | last post by:
Hello, First of all sorry if this is not the correct newsgroup for this question, but I am using PHP with MYSQL and someone here could have an answer and the experience. I have the a table (content) with some content and every time I edit it I store all the table contents in an other table (content_bak) when I want to restore the contents How am i going to do that ? I am trying to do :
0
1641
by: Lajos Kuljo | last post by:
Eine kleine Dokumentation. Gruss Joska MySQL Syntax SELECT select_expression,...
5
4011
by: red85 | last post by:
hello i have mysql 4.1 with win2000 SP3, i know that it is only an alpha and i don't know if someone else has already posted this problem: when i execute this sql UPDATE tableX SET fieldX=valueX WHERE id IN (SELECT tX.id FROM tableX AS tX WHERE tX.fieldY=valueY AND filedZ=valueZ);
1
433
by: David | last post by:
Hi, I have a quick question. I have a .asp application in which certain parts, clients can now edit/update/add information to their records in our DB. I basically use an include statement at the top of each page. The include .asp page has my connection data within .asp tags. The general 'user' to which the connection belongs only has 'select' facilities within the db.
3
1672
by: Craig Keightley | last post by:
Can these lines of sql statements be consolidated into one sql statement (possibly using reg exps??) BEGIN CODE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Update applications Set news_article = replace(news_article, '<FONT face="Times New Roman" color=#000000 size=3>', ''); Update applications Set news_article = replace(news_article, '<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">', ''); Update...
15
4639
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
1
3370
by: ajos | last post by:
hi evrybdy, the problem is:- i had this running before in jsp but when i changed the jsp page using struts tags there occoured a problem... when i enter values in the 2 text boxes and click enter an exception occours which is- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request.
2
2882
osward
by: osward | last post by:
Hello there, I am using phpnuke 8.0 to build my website, knowing little on php programing. I am assembling a module for my member which is basically cut and paste existing code section of various module that I found it useful. Here is the 1st problem I encounter: I had a function to edit a event row form the database which is fine with me, than I pass on the code to a function that save(update) the data to the database.
1
9582
ssnaik84
by: ssnaik84 | last post by:
Hi Guys, Last year I got a chance to work with R&D team, which was working on DB scripts conversion.. Though there is migration tool available, it converts only tables and constraints.. Rest of things (stored procedures, functions).. we have to manually edit. That time, we face some interesting challenges.. I failed to document all of them, but whatever I can share with u.. I will try.. :) ...
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.