Tag Archives: Database
Relationship using pivot table in Laravel 5? A method, belongsToMany(), is a part of Eloquent ORM in Laravel 5. It connects between tables and it has many to many relationship. In order to use it, you must have two models three tables.
You may want to create editable data using PHP and HTML. You want to take your date type value to your <select> HTML tag. It is not difficult, but yes we need to be patient to code it. First, you should call a query to your MySQL such as: Second, you have to set the […]
Storing a date from <select> HTML tag to MySQL database is not that easy. I spent three hours to find out how. First time I tried to, I was thinking that my script was not effective. But, after reading some tutorial I found my own way to do it. Here it is. MySQL script Put […]
If it is your first time to install WordPress, you can get annoying Error establishing a database connection. There must be some reasons why this annoying error message appears. Here are the checklist that may help you out: Check that your database is correct. When you create a database manually in cPanel. You must be […]
The syntax is easy to remember. SELECT * FROM <table> ORDER BY <field> <ASC/DESC> Example: mysql_query(“SELECT * FROM groceries ORDER BY shopname ASC”) mysql_query(“SELECT * FROM groceries ORDER BY shopaddress DESC”) mysql_query(“SELECT * FROM students ORDER BY department ASC”) If you don’t want to order it ascending or descending just remove ASC or DESC. It […]