Home > Archive > MySQL ODBC Connector > February 2006 > using WHERE and OR in a query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author using WHERE and OR in a query
Bruce Therrien

2006-02-28, 8:28 pm

Why does this query not work using mysql 3.23.58?
The query is updating all records with no regards to the WHERE clauses.
Do I need to do separate updates for each WHERE clause?

$SQL =<<SQL;
UPDATE $tablename SET rank = '$qdj_rank_en', rank_icon = '$qdj_rank_icon', qdj = qdj+'$adata{qdj_credit}', gold = gold+'$adata{gold_credit}' WHERE subscribe != '' OR artist = '1' OR rank_change != '1'
SQL
$dbh->do($SQL) || &cgierr("Reason: $!");



--
Bruce Therrien <bruce.therrien@wm-mw.org>

This is the end of the internet.
Please turn around and go back.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com