Jump to content

Recommended Posts

Hi,

 

I just use phpmyadmin and I've been trying to write a query that selects all "userid"  entries that are entered twice or more.

 

The table has fields: userid (int) and listid (int).

 

On a double entry the userid will be entered twice, once next to list 39 (for example) and a second time next to list 40.

 

Like:

 

userid | listid

1247 | 39

1247 | 40

 

I thought something like "(listid between 0 and 50 and listid between 0 and 50)" in the search conditions would work but it just selects everything.

 

Is there an "andalso" function? Or something else that would work?

 

Steve.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/88893-query-for-finding-duplicate-entries/
Share on other sites

Thanks guys for the answers,

 

I've tried many combinations of this in phpmyadmin but keep getting errors. Because I think the syntax must be different for there. What I do is I go into phpmyadmin through my website control panel and then click on the table in the database. There you can enter "where conditions" to search the table. I put them inside brackets like the instructions say: ( "where" ).

 

Do you know how I would put this sort of search in the "conditions" in phpmyadmin?

 

Steve.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.