/    Sign up×
Community /Pin to ProfileBookmark

How can I have two OR Statments in update database?

How do I add and or statement to my update query

[code=php]
$query= “UPDATE e_updates SET Name = ‘$Name’, Organization = ‘$Organization’, Email = ‘$Email’, Format = ‘$Format’ WHERE Name = ‘$Name'”;
[/code]

I need to add two more statments, WHERE Organization =’$Organization'” AND WHERE $Email = ‘$Email’

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Paul_JrMay 12.2004 — You just about had it, it would be
[code=php]
$query= "UPDATE e_updates SET Name = '$Name', Organization = '$Organization', Email = '$Email', Format = '$Format' WHERE Name = '$Name' AND Organization ='$Organization' AND $Email = '$Email'";[/code]

They just have to be separated by AND.

[url=http://www.w3schools.com/sql/sql_and_or.asp]W3 Schools[/url]
Copy linkTweet thisAlerts:
@d_brandusaauthorMay 12.2004 — does AND mean that has to be in the database, I want it to choose from either one...as long as the data exist in one of those columns. Would I use OR?
Copy linkTweet thisAlerts:
@Paul_JrMay 12.2004 — Ahh, I see. Yes, I believe OR would be what you want, instead of AND.
×

Success!

Help @d_brandusa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...