{"action":"created","issue":{"url":"https://api.github.com/repos/rorystandley/MySQL-CRUD-PHP-OOP/issues/17","labels_url":"https://api.github.com/repos/rorystandley/MySQL-CRUD-PHP-OOP/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/rorystandley/MySQL-CRUD-PHP-OOP/issues/17/comments","events_url":"https://api.github.com/repos/rorystandley/MySQL-CRUD-PHP-OOP/issues/17/events","html_url":"https://github.com/rorystandley/MySQL-CRUD-PHP-OOP/issues/17","id":102975343,"number":17,"title":"sql query problem?","user":{"login":"alleory","id":12956690,"avatar_url":"https://avatars.githubusercontent.com/u/12956690?v=3","gravatar_id":"","url":"https://api.github.com/users/alleory","html_url":"https://github.com/alleory","followers_url":"https://api.github.com/users/alleory/followers","following_url":"https://api.github.com/users/alleory/following{/other_user}","gists_url":"https://api.github.com/users/alleory/gists{/gist_id}","starred_url":"https://api.github.com/users/alleory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alleory/subscriptions","organizations_url":"https://api.github.com/users/alleory/orgs","repos_url":"https://api.github.com/users/alleory/repos","events_url":"https://api.github.com/users/alleory/events{/privacy}","received_events_url":"https://api.github.com/users/alleory/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-25T08:27:01Z","updated_at":"2015-08-25T09:33:51Z","closed_at":null,"body":"How can i use the query after your methoud??\r\n\r\nMy methoud of use\r\n$sql = \"SELECT * FROM news where id=\"$id\" LIMIT 1\";\r\n\r\nhow can i do it with this methoud???\r\n<?php\r\ninclude('class/mysql_crud.php');\r\n$db = new Database();\r\n$db->connect();\r\n$db->select('CRUDClass','id,name','name=\"Name 1\"','id DESC'); // Table name, Column Names, WHERE conditions, ORDER BY conditions\r\n$res = $db->getResult();\r\n\r\ni tried but i does not work, how you use the LIMIT????\r\n\r\n<?php\r\ninclude('class/mysql_crud.php');\r\n$db = new Database();\r\n$db->connect();\r\n$db->select('news', LIMIT 1);\r\n$res = $db->getResult();"},"comment":{"url":"https://api.github.com/repos/rorystandley/MySQL-CRUD-PHP-OOP/issues/comments/134539380","html_url":"https://github.com/rorystandley/MySQL-CRUD-PHP-OOP/issues/17#issuecomment-134539380","issue_url":"https://api.github.com/repos/rorystandley/MySQL-CRUD-PHP-OOP/issues/17","id":134539380,"user":{"login":"alleory","id":12956690,"avatar_url":"https://avatars.githubusercontent.com/u/12956690?v=3","gravatar_id":"","url":"https://api.github.com/users/alleory","html_url":"https://github.com/alleory","followers_url":"https://api.github.com/users/alleory/followers","following_url":"https://api.github.com/users/alleory/following{/other_user}","gists_url":"https://api.github.com/users/alleory/gists{/gist_id}","starred_url":"https://api.github.com/users/alleory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alleory/subscriptions","organizations_url":"https://api.github.com/users/alleory/orgs","repos_url":"https://api.github.com/users/alleory/repos","events_url":"https://api.github.com/users/alleory/events{/privacy}","received_events_url":"https://api.github.com/users/alleory/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T09:33:51Z","updated_at":"2015-08-25T09:33:51Z","body":"Tis is my whole code\r\n\r\n<?php\r\ninclude('class/crud.php');\r\n$db = new Database();\r\n$db->connect();\r\n$db->select('crud_news','','','','',1); // Table name\r\n$res = $db->getResult();\r\n?>\r\n\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n    <head>\r\n        <meta charset=\"utf-8\">\r\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n        <meta name=\"description\" content=\"\">\r\n        <meta name=\"author\" content=\"\">\r\n        <link rel=\"icon\" href=\"../../favicon.ico\">\r\n\r\n        <title>CRUD examples</title>\r\n        <link href=\"css/bootstrap.css\" rel=\"stylesheet\" type=\"text/css\"/>\r\n        <link href=\"css/bootstrap-theme.css\" rel=\"stylesheet\" type=\"text/css\"/>\r\n        <link href=\"css/main.css\" rel=\"stylesheet\" type=\"text/css\"/>\r\n    </head> \r\n\r\n    <body>\r\n\r\n        <div class=\"container\">\r\n\r\n            <!-- Static navbar -->\r\n            <nav class=\"navbar navbar-default\">\r\n                <div class=\"container-fluid\">\r\n                    <div class=\"navbar-header\">\r\n                        <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\r\n                            <span class=\"sr-only\">Toggle navigation</span>\r\n                            <span class=\"icon-bar\"></span>\r\n                            <span class=\"icon-bar\"></span>\r\n                            <span class=\"icon-bar\"></span>\r\n                        </button>\r\n                        <a class=\"navbar-brand\" href=\"#\">Project name</a>\r\n                    </div>\r\n                    <div id=\"navbar\" class=\"navbar-collapse collapse\">\r\n                        <ul class=\"nav navbar-nav\">\r\n                            <li class=\"active\"><a href=\"#\">Home</a></li>\r\n                            <li><a href=\"#\">About</a></li>\r\n                            <li><a href=\"#\">Contact</a></li>\r\n                            <li class=\"dropdown\">\r\n                                <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Dropdown <span class=\"caret\"></span></a>\r\n                                <ul class=\"dropdown-menu\">\r\n                                    <li><a href=\"#\">Action</a></li>\r\n                                    <li><a href=\"#\">Another action</a></li>\r\n                                    <li><a href=\"#\">Something else here</a></li>\r\n                                    <li role=\"separator\" class=\"divider\"></li>\r\n                                    <li class=\"dropdown-header\">Nav header</li>\r\n                                    <li><a href=\"#\">Separated link</a></li>\r\n                                    <li><a href=\"#\">One more separated link</a></li>\r\n                                </ul>\r\n                            </li>\r\n                        </ul>\r\n                        <ul class=\"nav navbar-nav navbar-right\">\r\n                            <li class=\"active\"><a href=\"./\">Default <span class=\"sr-only\">(current)</span></a></li>\r\n                            <li><a href=\"../navbar-static-top/\">Static top</a></li>\r\n                            <li><a href=\"../navbar-fixed-top/\">Fixed top</a></li>\r\n                        </ul>\r\n                    </div><!--/.nav-collapse -->\r\n                </div><!--/.container-fluid -->\r\n            </nav>\r\n\r\n            <div class=\"jumbotron\">\r\n                <h1>Navbar example</h1>\r\n                <p>This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>\r\n                <p>\r\n                    <a class=\"btn btn-lg btn-primary\" href=\"../../components/#navbar\" role=\"button\">View navbar docs &raquo;</a>\r\n                </p>\r\n            </div>\r\n\r\n            <div class=\"row\">\r\n                \r\n                <?php\r\n                \r\n                foreach ($res as $row){\r\n                    \r\n                ?>\r\n                \r\n                <div class=\"col-xs-6 col-lg-4\">\r\n                    <p><img src=\"img/<?php echo $row['img']; ?>\"></p>\r\n                    <h2><?php echo $row['title']; ?></h2>\r\n                    <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>\r\n                    <p><a class=\"btn btn-default\" href=\"#\" role=\"button\">View details &raquo;</a></p>\r\n                </div><!--/.col-xs-6.col-lg-4-->\r\n                \r\n                <?php\r\n                \r\n                }\r\n                   \r\n                ?>\r\n               \r\n\r\n            </div><!--/row-->\r\n            <hr>\r\n\r\n            <footer>\r\n                <p>&copy; Company 2014</p>\r\n            </footer>\r\n        </div><!--/.col-xs-12.col-sm-9-->\r\n\r\n\r\n    </div> <!-- /container -->\r\n\r\n    <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\"></script>\r\n    <script src=\"../../dist/js/bootstrap.min.js\"></script>\r\n    <script src=\"../../assets/js/ie10-viewport-bug-workaround.js\"></script>\r\n</body>\r\n</html>\r\n"}}