Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 ASP + MySQL... Need help for tricky select...

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-07 : 11:24:11
Ossian writes "Hi...



I'm making a "Hot or Not" system in asp and MySQL, and I'm having problems selecting posts that people have not voted for earlier.

I hope this info is enough...

I got two tables:

PICTURES - Fields: pid (picture id) | gender (gender of the person on the picture)

VOTES - Fiels: vid (vote id) | pic (picture id) | uid (user id of the person voting, random generated and called from a cookie.. i.e. vbgpnuxhebtdkkbnncdfeorsyjevhj) | rating (rating 1-10)

Now.. what I want to dois to only select post that have not been voted for earlier.. And I tried to do it like this:

Conn.Execute("SELECT * FROM pictures, votes WHERE ((pictures.pid != votes.pid) || (votes.uid != '" & strUserId &"')) && (pictures.gender = '"& strGender &"')")

But it doesn't work.. I always get the same id out..

I Hope this info is enough.. Otherwise ask and I'll provide all u need..

Thank you so much!! I Worked like 15 hours on this stupid line.. lol

All the best from Copenhagen.."

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-05-08 : 06:23:59
1. This is an MSSQLserver forum.....you might be best targetting a MYSQL forum for more focussed experience.
2. You might also be advised to start using the "SELECT * from tablea inner join tableb on table2.colx = tableb.coly" format for JOINING 2 tables, as this latter format is more understood (and over time will become the only supported format)....it will also allow everybody else trying to help you to bypass mysql particular formats (if any)
Go to Top of Page
   

- Advertisement -