EchoFool Posted November 26, 2008 Share Posted November 26, 2008 I just been working on a site for months with no problems then suddenly i made a query with an inner join and this is not the first inner join i have ever used on the site and it keeps giving me: SELECT command denied to user Yet its only one this one specific query, additionally the syntax is perfectly correct, what does it mean? I don't know why it won't allow it. Hope you can help. Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/ Share on other sites More sharing options...
scarhand Posted November 26, 2008 Share Posted November 26, 2008 posting the query would be a start Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699514 Share on other sites More sharing options...
EchoFool Posted November 26, 2008 Author Share Posted November 26, 2008 <?php $Get = mysql_query("SELECT user_m.Quantity FROM user_m INNER JOIN user.c ON user_m.UserID = user_c.UserID WHERE user_c.SID='{$row['StateID']}' AND user_m.MID='{$row2['MID']}'") Or die(mysql_error()); ?> Here you go, Its only this query which is what i find odd. All my other queries are allowed yet this one is denied.. I checked with my hosts and they say i have full permissions to my database so its not my server permissions. Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699530 Share on other sites More sharing options...
Maq Posted November 26, 2008 Share Posted November 26, 2008 Weird. Have you tried putting this query in PhpMyAdmin? Replacing the $rows with testing values. Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699540 Share on other sites More sharing options...
trq Posted November 26, 2008 Share Posted November 26, 2008 It meens that the user your using to login to mysql with does not have permission to execute SELECT queries on the selected database. Are you sure other (simpler) SELECTs work with this same user / pass combination? Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699552 Share on other sites More sharing options...
EchoFool Posted November 26, 2008 Author Share Posted November 26, 2008 What do you mean by user though ? My usual login account for the site or my server user? All other select queries are working on the site its just this one particular query where it goes wrong...but how can check that the simpler SELECTS work ? I mean the whole site works bar this one script which im guessing would leave to suggest it does work ? Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699563 Share on other sites More sharing options...
trq Posted November 26, 2008 Share Posted November 26, 2008 What do you mean by user though ? My usual login account for the site or my server user? The user you use to connect to the mysql database server. but how can check that the simpler SELECTS work ? Try one. Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699565 Share on other sites More sharing options...
EchoFool Posted November 26, 2008 Author Share Posted November 26, 2008 Argh i found the problem notice line one straight after 'inner join' i put user.c instead of user_c !! Blast ! Still a bit odd why it didnt just say table not found.. but its working now Thanks everyone. Quote Link to comment https://forums.phpfreaks.com/topic/134309-solved-select-command-denied-to-user/#findComment-699575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.