[PHP-DB] MySQL update statement problem

2006-03-04 Thread Kevin Davies - Bonhurst Consulting
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

Re: [PHP-DB] MySQL update statement problem

2006-03-04 Thread Chris
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 =

RE: [PHP-DB] MySQL update statement problem

2006-03-04 Thread Kevin Davies - Bonhurst Consulting
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

Re: [PHP-DB] MySQL Update Quandry

2005-11-27 Thread Glenn Deschênes
. .$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

RE: [PHP-DB] MySQL Update Quandry

2005-11-26 Thread Rich Hutchins
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

[PHP-DB] MySQL Update Quandry

2005-11-25 Thread maestro
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());

[PHP-DB] mySQL UPDATE

2005-06-09 Thread Ron Piggott
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

Re: [PHP-DB] mySQL UPDATE

2005-06-09 Thread Philip Hallstrom
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

[PHP-DB] MySQL Update and Sort Queries

2004-02-19 Thread Ng Hwee Hwee
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,

[PHP-DB] MySql Update.

2002-11-12 Thread David Rice
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

Re: [PHP-DB] MySql Update.

2002-11-12 Thread Adam Voigt
$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

Re: [PHP-DB] MySql Update.

2002-11-12 Thread Marco Tabini
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

[PHP-DB] MySQL Update failing...

2002-06-27 Thread NIPP, SCOTT V (SBCSI)
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

RE: [PHP-DB] MySQL Update failing...

2002-06-27 Thread Ryan Jameson (USA)
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

RE: [PHP-DB] MySQL Update failing...

2002-06-27 Thread NIPP, SCOTT V (SBCSI)
: 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

RE: [PHP-DB] MySQL Update command syntax

2002-02-01 Thread Rick Emery
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

[PHP-DB] MySQL Update Logging ???

2001-09-20 Thread Christopher Raymond
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

Re: [PHP-DB] MySQL Update Logging ???

2001-09-20 Thread Jason G.
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

[PHP-DB] MySQL UPDATE problem

2001-08-30 Thread Malcolm White
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

Re: [PHP-DB] MySQL UPDATE problem

2001-08-30 Thread Paul Burney
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.