Hi,
Apologies if this isn't the right place to ask - but I'm banging my head
against the wall with this one!
I'm trying to update a record in the table (creation script below) using the
following SQL statement:
UPDATE shop_customer SET eu_vat_number = SK1234567890 AND vat_amount = 0
AND
You need to separate the SET arguments with commas, not ANDs...
It's really doing something like this:
UPDATE shop_customer SET eu_vat_number = (SK1234567890 AND vat_amount = 0
AND total_amount = 8.4925) WHERE customer_id = 7 AND hash=dcd5e751
(SK1234567890 AND vat_amount = 0 AND total_amount =
Message-
From: Jenaro Centeno Gómez [mailto:[EMAIL PROTECTED]
Sent: 04 March 2006 17:35
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL update statement problem
Maybe I am wrong, biut isn´this the rigth way to do this:
UPDATE shop_customer SET eu_vat_number = SK1234567890, vat_amount =
0
. .$queryresult. rows were
altered.;
}
echo $msg;
Hope this helps.
Rich
-Original Message-
From: maestro [mailto:[EMAIL PROTECTED]
Sent: Friday, November 25, 2005 1:11 PM
To: php-db@lists.php.net
Subject: [PHP-DB] MySQL Update Quandry
Greetings,
I am doing an update
Subject: [PHP-DB] MySQL Update Quandry
Greetings,
I am doing an update to a table as such:
class DB {
function updateMember($email, $password, $postalCode,
$language, $id, $word) {
...
if (!(@ mysql_query($query, $connection))) {
$this-errors = array
Greetings,
I am doing an update to a table as such:
class DB {
function updateMember($email, $password, $postalCode,
$language, $id, $word) {
...
if (!(@ mysql_query($query, $connection))) {
$this-errors = array(mysql_errno(), mysql_error());
I created a PHP based mailing list that sends out a Bible verse and a
quotation each day. Today's verses were:
Bible verse of the day:
Matthew 17:19-21 Then the disciples came to Jesus privately and said, Why
could we not cast it out? And He said to them, Because of the littleness
of your
On Thu, 9 Jun 2005, Ron Piggott wrote:
I created a PHP based mailing list that sends out a Bible verse and a
quotation each day. Today's verses were:
[snip]
Let me show you some code:
It selects a Bible verse:
SELECT * FROM bible ORDER BY RAND() LIMIT 1
On a side note, this is going to
hi all,
1) Question on UPDATE
My situation is this: I want to update Table1 with values that can be found in
Table2.. in short, I would like to do the following:
$query = update Table1, Table2 set Table1.field1 = Table2.field2 where Table1.no =
Table2.no;
however,
Making an update query that adapts to the number of fields that are to be
updated
Is there anyway to do like a for loop to create the values part of the query
then combine it with the first part of the string.
something like what i have below... although something that works correctly
as
$query = UPDATE tablename SET ;
foreach($_POST AS $key = $value)
$query .= $key = '$value',;
$query[strlen($query)-1] = ;
$query .= WHERE id = '$_GET[id]';
Or something?
On Tue, 2002-11-12 at 13:58, David Rice wrote:
Making an update query that adapts to the number of fields that
How about:
function do_query ($table, $fields, $where)
{
$sql = 'update ' . $table . ' Set ';
foreach ($fields as $k=$v)
$sql = $k . ' = \'' . $v . '\',';
return mysql_query ($sql);
}
Not sure if it adapts 100% to your case but you can probably fix it
In need of some help. I have a PHP form page that is updating a
MySQL database that is not working. Here is the code for the three pages
that work together for this application. The oncall_new.php works fine to
insert new records into the database, and the oncall_log.php works fine to
I didn't get your attachements. Maybe paste them in a row into the email?
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 10:07 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] MySQL Update failing...
In need of some help. I
: Thursday, June 27, 2002 11:07 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] MySQL Update failing...
In need of some help. I have a PHP form page that is updating a
MySQL database that is not working. Here is the code for the three pages
that work together for this application
Correct your example as follows:
$sql = UPDATE $table_name SET new_area=\$new_area\;
-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 26, 2002 10:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Update command syntax
Could anyone help me out
NOTES: I know this is a PHP list, but I also know that many of you are
experienced MySQL admins. In addition, I was unable to find a MySQL
newsgroup, so if you can help me out there, I would appreciated it and would
most certainly post my question there.
QUESTION: My ISP does not enable update
Check out for MySQL mailing lists
http://www.mysql.com/documentation/lists.html
-JAson Garber
At 03:42 PM 9/20/2001 -0500, Christopher Raymond wrote:
NOTES: I know this is a PHP list, but I also know that many of you are
experienced MySQL admins. In addition, I was unable to find a MySQL
I am having a problem with UPDATE queries with MySQL. Insert, Delete, etc
work fine. I have checked the query statement and it works fine directly
with MySQL just not in a PHP script. An example function is;
function update_gname($gid, $new_name){
$query = UPDATE Groups SET
on 8/30/01 4:06 PM, Malcolm White at [EMAIL PROTECTED] wrote:
$query = UPDATE Groups SET GName=$new_name WHERE GID=$gid;
If the Gname field is a string type, there should probably be quotes around
it.
$query = 'UPDATE Groups SET GName=' . $new_name . ' WHERE GID=' . $gid;
HTH.
20 matches
Mail list logo