# MySQL Argument not working

**URL:** <https://forum.kirupa.com/t/mysql-argument-not-working/185875>\
**Category:** programming\
**Created:** [April 17, 2006, 10:54am UTC](https://forum.kirupa.com/t/mysql-argument-not-working/185875 "2006-04-17T10:54:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [April 17, 2006, 10:54am UTC](https://forum.kirupa.com/t/mysql-argument-not-working/185875/1 "2006-04-17T10:54:13Z")

</div>

$query = “SELECT \* FROM users WHERE cellid = ‘$currcell’ && WHERE username != ‘$currusername’”;

How come this isn’t working? I want to select all the rows where the cellid equal a certain value and exclude the row of the current username?

---

<div class="post-metadata">

**Author:** ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)\
**Post date:** [April 17, 2006, 11:11am UTC](https://forum.kirupa.com/t/mysql-argument-not-working/185875/2 "2006-04-17T11:11:39Z")

</div>

You should remove that second WHERE.

---

<div class="post-metadata">

**Author:** ![devinstar](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@devinstar](https://forum.kirupa.com/u/devinstar)\
**Post date:** [April 17, 2006, 11:32am UTC](https://forum.kirupa.com/t/mysql-argument-not-working/185875/3 "2006-04-17T11:32:32Z")

</div>

thanks, works now
