RE: Update Query Help...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



is it a mysql field type of datetime?

if so, you may want to use this instead
$timestamp=date("Y-m-j H:i:s");
$update = "UPDATE accounts SET atime='$timestamp' WHERE id-sys='$tmp'";

that puts the current timestamp in mysql format for entry into your table.

Cheers
Jason

-----Original Message-----
From: NIPP, SCOTT V (SBCSI) [mailto:sn4265@sbc.com]
Sent: Tuesday, December 10, 2002 1:35 PM
To: 'php-db@lists.php.net'
Subject:  Update Query Help...


	I am attempting to UPDATE a table and I have having absolutely ZERO
success.  Here is the query:

	$tmp = $_POST['sbcuid']."-".$_POST['system'][$a];
	$update = "UPDATE accounts SET atime='NOW()' WHERE
\"id-sys\"='".$tmp."'";
	echo $update;
	$result1 = mysql_query($update, $Prod) or die(mysql_error());
	echo mysql_affected_rows();

	Please help me figure out why this is not working.  I have tried
quoting the column name 'id-sys' every way I can think of, but nothing
works.  The column is initially NULL, and I am attempting to update just the
single column with a timestamp.  Thanks in advance.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@sbc.com
Web:  http:\\ldsa.sbcld.sbc.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux