EPCtech Posted June 13, 2009 Share Posted June 13, 2009 Hi, I have an upload file system so that users may post their own games on my website for my visitors to play. It's supposed to select files that only the user has posted. But for some reason it selects all files or half of the files. $sql=mysql_query("SELECT * FROM myfiles WHERE user='".$USERname."' AND (file LIKE '%.zip') OR (file LIKE '%.gmk') OR (file LIKE '%.exe')"); This code gets me files from a user named "coffee". Is there anything wrong with my code? I hope I described it well enough. En-Psyche Link to comment https://forums.phpfreaks.com/topic/162011-file-selecting-not-working/ Share on other sites More sharing options...
dreamwest Posted June 13, 2009 Share Posted June 13, 2009 Looks fine. Make sure $USERname has a value by echoing it out Link to comment https://forums.phpfreaks.com/topic/162011-file-selecting-not-working/#findComment-854882 Share on other sites More sharing options...
Maq Posted June 13, 2009 Share Posted June 13, 2009 I think you want your query like this: $sql=mysql_query("SELECT * FROM myfiles WHERE user='".$USERname."' AND (file LIKE '%.zip' OR file LIKE '%.gmk' OR file LIKE '%.exe')"); Link to comment https://forums.phpfreaks.com/topic/162011-file-selecting-not-working/#findComment-854883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.