; To:
php-general@lists.php.net> Date: Mon, 29 Dec 2008 12:05:37 -0500> Subject:
[PHP] Php mysql update> > Okay maybe i have just forgot.> I am trying to update
the database and do a +1 to a int field without pulling the data and adding 1
to it and sticking it back in.> &
Wouldn't it be:
mysql_query("UPDATE database set Field = Field+1 WHERE
Criteria='Criteria'");
Note: no '' around +1, = operator
John Corry
ad...@buskirkgraphics.com wrote:
> Okay maybe i have just forgot.
> I am trying to update the database and do a +1 to a int field without pulling
> the data
Hello, you have to do :
$dwsl = mysql_query('UPDATE database SET "Field"="Field"+1 WHERE
"Criteria"=\'Criteria\'');> From: ad...@buskirkgraphics.com> To:
php-general@lists.php.net> Date: Mon, 29 Dec 2008 12:05:37 -0500> Subject:
Okay maybe i have just forgot.
I am trying to update the database and do a +1 to a int field without pulling
the data and adding 1 to it and sticking it back in.
Someone refresh me on this please.
I think it is something like.
$dwsl = mysql_query("UPDATE database set Field='+1' WHERE Criteria='Cr
Thanks!
-W
"M" <[EMAIL PROTECTED]> kirjoitti
viestissä:[EMAIL PROTECTED]
> It seems the upgrade was from Mysql 4.0. PASSWORD() function changed
> between 4.0 and 4.1, it uses longer hashes now. You can still use
> OLD_PASSWORD() function instead.
>
> William Stokes wrote:
>> Hello,
>>
>> My IS
It seems the upgrade was from Mysql 4.0. PASSWORD() function changed
between 4.0 and 4.1, it uses longer hashes now. You can still use
OLD_PASSWORD() function instead.
William Stokes wrote:
Hello,
My ISP updated their MySQL DB to 5.0.18 and that killed my login procedure
which was OK yesterd
Hello,
My ISP updated their MySQL DB to 5.0.18 and that killed my login procedure
which was OK yesterday. Any ideas how to start to debug this?
The login updates 2 fields in users table row where username and password
macthes. This is the code:
if (!$query = mysql_query("update tbl_users set
I am prepared to be wrong (but I'm too lazy to go and try it)...
does MySql return a detailed enough error message to detect *which* field
caused the problem. IIRC, I don't think it does.
Anyway *if* it does it will be in here...
http://www.mysql.com/doc/en/Error-returns.html
DUP UNIQUE I guess
[snip]
How can I improve on the above to give specific error information.
[/snip]
Use mysql_error() http://www.php.net/mysql_error
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
I have an update statement that tries to update a number of values - these values have
unique value constraint so when I do the update it will either succeed or fail. If it
fails how can I determine where the update failed. i.e. pinpoint the value that was
not unique?
At the moment I am do
off (only 10
minutes to go), so I wasn't really thinking when I typed it.
Honestly, a unique index may be the best bet...
-Original Message-
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 17:13
To: Php-General
Subject: Re: [PHP] mysql update query
I used single.
bit!
unless of course someone can come in with a last minute flash of
inspiration!
i really really don't need this at 5:12 on a friday afternoon!
-Original Message-
From: Jonathan Wilkes [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 17:00
To: Enda
Subject: RE: [PHP] mysql upd
Jonathan Wilkes [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:39
To: Enda; Php-General
Subject: RE: [PHP] mysql update query
Hi Enda,
Does your table have an index per record ?
If so, your WHERE clause could just use the index and thus be far simpler,
if "A_Number" is an indexed fiel
Hello Enda,
Friday, December 19, 2003, 4:32:44 PM, you wrote:
E> which returns the following SQL query:
E> UPDATE cdr200311 SET Price=0.225 WHERE (A_Number = 61210146 AND
E> StartDateTime = 2003110216502400 AND Duration=15.0167 AND SMSDestinationName
E> = '1010')
E> The query executes successful
ERE
Darka
www.xfcpro.com
-Original Message-
From: Enda [mailto:[EMAIL PROTECTED]
Sent: 19 December 2003 16:33
To: Php-General
Subject: [PHP] mysql update query
Hi guys
Bit of a problem I'm having here with an update query on a PHP/MySQL site:
This is the db query I execute:
$resu
Hi guys
Bit of a problem I'm having here with an update query on a PHP/MySQL site:
This is the db query I execute:
$result6=mysql_query("UPDATE $WorkTable SET Price=$CallCost WHERE (A_Number
= $A_Number AND StartDateTime = $D_Full AND Duration=$Duration AND
SMSDestinationName = '$SMSDestinationNa
hmmm can you check to see if your field is exactly named desc in the
table... also whether or not it can accept string ie char or varchar.
- Original Message -
From: "Steven Efurd" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 2:03 P
I have the following code:
$sql = "UPDATE class_sub SET desc = '$catdesc', sub_cat = '$subcatname'
WHERE id='$catid'";
echo $sql;
$sql_result = mysql_query($sql);
if (!$sql_result)
{
echo "Couldn't update record!";
echo mysql_error();
exit;
} else
{
header("Location: ind
;jesse" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 11:50 AM
Subject: Re: [PHP] Mysql update problems
No, the query is working fine... all variables are printing correctly.
This is what has me confused. Everything seems to be as it should, it's
ju
AIL PROTECTED]>
Sent: Sunday, January 05, 2003 10:27 AM
Subject: [PHP] Mysql update problems
I've been scratching my head over the following code
for a while now. It's supposed to check a given
weblog for specific tags, and if they're present,
update the weblog's table in my d
On Monday 06 January 2003 00:27, Jesse Lawrence wrote:
> I've been scratching my head over the following code
> for a while now. It's supposed to check a given
> weblog for specific tags, and if they're present,
> update the weblog's table in my database. I believe
> the problem is around the exe
Original Message -
From: "Jesse Lawrence" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 10:27 AM
Subject: [PHP] Mysql update problems
I've been scratching my head over the following code
for a while now. It's supposed to check
I've been scratching my head over the following code
for a while now. It's supposed to check a given
weblog for specific tags, and if they're present,
update the weblog's table in my database. I believe
the problem is around the execution of the db query,
but I can't seem to get it figured out.
On Friday, April 5, 2002, at 01:58 PM, Phil Schwarzmann wrote:
> Is this query legal?
>
> $query = "UPDATE table SET (var1, var2, var3) VALUES ($var1, $var2,
> $var3) WHERE username='$username'";
No. The SET modifier (or whatever that is) can only be used to create
column name/value rela
what happened when you tried your query?
-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL - UPDATE & INSERT
Is this query legal?
$query = "UPDATE table SET (var1, v
The UPDATE syntax in the manual:
http://www.mysql.com/doc/U/P/UPDATE.html
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
SET col_name1=expr1, [col_name2=expr2, ...]
[WHERE where_definition]
[LIMIT #]
Yes, it is different than the INSERT syntax.
PS> ...but only there are like 150 diffe
Is this query legal?
$query = "UPDATE table SET (var1, var2, var3) VALUES ($var1, $var2,
$var3) WHERE username='$username'";
Im wondering cause I have an INSERT query
$query = "INSERT INTO table (var1, var2, var3) VALUES ($var1, $var2,
$var)";
...but only there are like 150 diffe
On Wed, 20 Mar 2002, ROBERT MCPEAK wrote:
> $sql = "UPDATE mytable SET
> img_url=$img_url,visitdate=$visitdate,img_group=$img_group,display=$display,
> caption=$caption where id = $id";
You need to surround non-numeric values with 'single quotes'.
$sql = "update mytable s
if ($postaction=="edit")
-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 11:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql update help needed
Can somebody straighten this out for me?
I can't get the update to work
Can somebody straighten this out for me?
I can't get the update to work. I'm sure the variables are being
passed to the code. Thanks!
if ($postaction==edit)
{
echo "it fired";
// process form
$db = mysql_connect("myhost, "myunam
TECTED]]
Sent: December 5, 2001 11:37 AM
To: 'Tyler Longren'; Greg Sidelinger; [EMAIL PROTECTED]
Subject: RE: [PHP] mysql update query
are any of the fields of type number/integer/etc? if so, try removing the
quotes for that field.
-Original Message-
From: Tyler Longren [mail
id='$id'");
>
>Although I doubt MySQL cares if certain words are capitalized.
>
>Good luck though,
>Tyler Longren
>
>----- Original Message -
>From: "Greg Sidelinger" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, Decembe
are any of the fields of type number/integer/etc? if so, try removing the
quotes for that field.
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 2:36 PM
To: Greg Sidelinger; [EMAIL PROTECTED]
Subject: Re: [PHP] mysql update query
On Wed, 5 Dec 2001 13:57, Greg Sidelinger wrote:
> I'm having trouble getting an update query to work
>
> Here is what I'm doing
>
> $result = mysql_query("update table set value1='$value1',
> value2='$value2' where id='$id'");
>
> It is not updating the database. All the $vars have values and I
ge -
From: "Greg Sidelinger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 04, 2001 9:27 PM
Subject: [PHP] mysql update query
> I'm having trouble getting an update query to work
>
> Here is what I'm doing
>
> $result = mysql_query
I'm having trouble getting an update query to work
Here is what I'm doing
$result = mysql_query("update table set value1='$value1',
value2='$value2' where id='$id'");
It is not updating the database. All the $vars have values and I'm
using the correct columns names. Could someone please po
At 21:40 10/5/2001 -0400, [EMAIL PROTECTED] wrote:
>why isnt this working
>
>i need to get 5 values updated in a table called 'user_polls'
>
>how do I do this?
>i have
>
>UPDATE user_polls WHERE id = '$id' VALUES($1, $2. and so on
your statement is incorrect... the correct UPDATE syntax is:
; statement.
Mark C.
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 10, 2001 9:40 PM
Subject: [PHP] mysql: UPDATE statment
> why isnt this working
>
> i need to get 5 values updated in a table called 'user_polls'
&
=
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
* We rent the dot in .COM! **
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 11:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql: UPDA
why isnt this working
i need to get 5 values updated in a table called 'user_polls'
how do I do this?
i have
UPDATE user_polls WHERE id = '$id' VALUES($1, $2. and so on
im getting a SQL error
anyone?
- Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EM
40 matches
Mail list logo