[PHP] Re: MySQL update

2004-02-24 Thread Howard Miller
You can't well, not via PHP anyway. You would need to do a select first to establish if any of these values exist in the database. Something like... select first,last,email from mytable where first=x or last=y or email=z; then check which one of first,last,email is non-empty. BUT.. do you *

[PHP] Re: mysql update not working

2003-06-26 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > 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

[PHP] Re: MySQL - UPDATE & INSERT

2002-04-05 Thread Chris Adams
In article <[EMAIL PROTECTED]>, Phil Schwarzmann wrote: > $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, > $

[PHP] Re: mysql update query

2001-12-05 Thread Richard Creech - DreamRiver.com
Greg, You must specify the tablename :) Like this: UPDATE myTableName ... or mysql> UPDATE persondata SET age=age+1; For the official syntax visit mysql language reference at http://www.mysql.com at http://www.mysql.com/doc/U/P/UPDATE.html Kind Regards, Richard Creech [EMAIL PROTECTED] 250.744