phpretard Posted January 25, 2008 Share Posted January 25, 2008 I think the problem with this query is the space between The and President. Is there any way to leave a space there an it still work? $position="The President"; mysql_query("SELECT * FROM links WHERE $position='1' "); Quote Link to comment https://forums.phpfreaks.com/topic/87709-solved-space-in-a-query/ Share on other sites More sharing options...
phpretard Posted January 25, 2008 Author Share Posted January 25, 2008 Is this question clear? Quote Link to comment https://forums.phpfreaks.com/topic/87709-solved-space-in-a-query/#findComment-448626 Share on other sites More sharing options...
sstangle73 Posted January 25, 2008 Share Posted January 25, 2008 there is no question what is the problem with the script i belive that you cant have spaces in a sql field ill double check tho space seemed to work fine when i added the field whats the error your getting? Quote Link to comment https://forums.phpfreaks.com/topic/87709-solved-space-in-a-query/#findComment-448628 Share on other sites More sharing options...
ziv Posted January 25, 2008 Share Posted January 25, 2008 mysql let you use spaces in the fields nme - but it is a bad habit. that is the way you can run your query: "select * from `links` where `$position`=1" and i hope the $position is field name.... Quote Link to comment https://forums.phpfreaks.com/topic/87709-solved-space-in-a-query/#findComment-448631 Share on other sites More sharing options...
phpretard Posted January 25, 2008 Author Share Posted January 25, 2008 For some reason it works with what looks like the same code. Thank you for your help and advise!! -Anthony Quote Link to comment https://forums.phpfreaks.com/topic/87709-solved-space-in-a-query/#findComment-448638 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.