Sbosh Posted April 13, 2020 Share Posted April 13, 2020 Good day everyone. I go by the nickname Sbosh and I am a newbie in PHP. I am currently learning php using video tutorials. I need help with regards to php queries. I have the following code: "SELECT 'food', 'calories' FROM 'diet' ORDER BY 'id'" which is supposed to display content from a table inside phpmyadmin which i created manually using phpmyadmin. But It gives an error saying i must check the MariaDB version on how to right this query, something like that. Please assist on the proper way of writing this code. Again I am a newbie in PHP and just starting to learn, so your help will be highly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/310558-php-queries/ Share on other sites More sharing options...
Barand Posted April 13, 2020 Share Posted April 13, 2020 Column and table identifiers should not be in quotes. Only string literals should be quoted. Remove the single quotes from the query. Quote Link to comment https://forums.phpfreaks.com/topic/310558-php-queries/#findComment-1576766 Share on other sites More sharing options...
Sbosh Posted April 13, 2020 Author Share Posted April 13, 2020 Hi Barand its me Sbosh. Ok I will try your solution and get back to you. Quote Link to comment https://forums.phpfreaks.com/topic/310558-php-queries/#findComment-1576768 Share on other sites More sharing options...
Sbosh Posted April 13, 2020 Author Share Posted April 13, 2020 Hi Barand thanks it worked. Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/310558-php-queries/#findComment-1576769 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.