background preloader


Facebook Twitter


Phpmyadmin - MySQL date column auto fill with current date. PhpMyAdmin: Zusatzfunktionen aktivieren mit dem Configuration Storage - Open Mind. Der Datenbank-Manager phpMyAdmin verfügt über einige nützliche Funktionen, welche insbesondere die Arbeit mit Beziehungen vereinfachen.

phpMyAdmin: Zusatzfunktionen aktivieren mit dem Configuration Storage - Open Mind

Leider sind sie in der Standardinstallation nicht verfügbar. Dieser Artikel beschreibt zunächst einige dieser Funktionen und zeigt dann, wie man den dafür erforderlichen phpMyAdmin Configuration Storage konfiguriert. Zusatzspalten in Fremdschlüssel-Dropdowns Nehmen wir an, wir haben eine Beziehung zwischen den Tabellen company und employee definiert. Jeder Angestellte soll dabei genau einer Firma zugeordnet werden, eine Firma kann eine beliebige Anzahl von Angestellten haben. Geht es nun an die Erfassung der Angestellten, dann ist die Zuordnung zu einer Firma etwas mühsam, weil man die ID (also den Primärschüsselwert) der Firmen kennen muss. Ist der Configuration Storage konfiguriert, dann geht dies ganz einfach: Man muss lediglich in der Parent Table die anzuzeigende Spalte (engl. Grafisches Datenbankschema im phpMyAdmin Designer. Mysql auto date on change.

Sql - MySQL auto-store datetime for each row. The Ultimate Guide to MySQL EXISTS By Examples. Database - Is it wise to declare a VARCHAR with a value greater than 255 in MySQL? How to Optimize MySQL: Indexes, Slow Queries, Configuration. MySQL is still the world’s most popular relational database, and yet, it’s still the most unoptimized – many people leave it at default values, not bothering to investigate further.

How to Optimize MySQL: Indexes, Slow Queries, Configuration

In this article, we’ll look at some MySQL optimization tips we’ve covered previously, and combine them with novelties that came out since. Configuration Optimization The first – and most skipped! – performance upgrade every user of MySQL should do is tweak the configuration. 5.7 (the current version) has much better defaults than its predecessors, but it’s still easy to make improvements on top of those. We’ll assume you’re using a Linux-based host or a good Vagrant box like our Homestead Improved so your configuration file will be in /etc/mysql/my.cnf. Editing Configuration You’ll need to be comfortable with using the command line.

Sequel Pro Alternatives for Windows - Working with JSON in MySQL ― Scotch. Convert Your Legacy SQL to Laravel Builder with Orator. Mysql - What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN?


Storing JSON data in a database column. How to Use JSON Data Fields in MySQL Databases. In my article SQL vs NoSQL: The Differences, I mentioned the line between SQL and NoSQL databases has become increasingly blurred with each camp adopting features from the other.

How to Use JSON Data Fields in MySQL Databases

MySQL 5.7 InnoDB and PostgreSQL 9.4 databases both directly support JSON document types in a single field. In this article, we’ll examine MySQL’s JSON implementation in more detail. (PostgreSQL supported JSON before version 9.4 and any database will accept JSON documents as a single string blob. However, MySQL and PostgreSQL now directly support validated JSON data in real key/value pairs rather than a basic string.) Just Because You Can Store JSON … … it doesn’t follow you should. Normalization is a technique used to optimize the database structure. If you have clear relational data requirements, use appropriate single-value fields. That said, there are good JSON use-cases for sparsely-populated data or custom attributes. Developer Zone. Usability problems of mysqli compared to PDO.


Usability problems of mysqli compared to PDO

By no means I am going to say that mysqli is worse than PDO. Mysqli is an excellent extension, with many specific features. But it's just not intended to be used directly. To make it usable, one have to always wrap it into a helper library, to reduce the enormous amount of code that otherwise have to be written by hand. I myself have such a wrapper library, SafeMysql, which I am very happy with (and which in many aspects is better than vanilla PDO). But for the average PHP/MySQL user, standard APIs are the only known methods for database interaction.

Note that this article is written out of premise that a query should be consisted of constant values only. Named placeholders To me it's rather a yet another source of confusion (there are thousands questions on Stack Overflow, caused by mere typos in placeholder names), which also makes your code bloated. MySQL Workbench: Visual Database Design. Visual Database Schema Design MySQL Workbench simplifies database design and maintenance, automates time-consuming and error-prone tasks, and improves communication among DBA and developer teams. It enables data architects to visualize requirements, communicate with stakeholders, and resolve design issues before a major investment of time and resources is made. It enables model-driven database design, which is the most efficient methodology for creating valid and well-performing databases, while providing the flexibility to respond to evolving business requirements. Model and Schema Validation utilities enforce best practice standards for data modeling, also enforce MySQL-specific physical design standards so no mistakes are made when building new ER diagrams or generating physical MySQL databases.

Forward and Reverse Engineering. MySQL Workbench Tutorial. GitHub - damiantw/laravel-scout-mysql-driver: Laravel Scout MySQL Driver. Visual Database Creation with MySQL Workbench. In today’s tutorial, you’ll learn how to use a visual database modeling utility to draw a database diagram and automatically generate SQL.

Visual Database Creation with MySQL Workbench

Specifically, we’ll review how to use MySQL Workbench, a cross-platform, visual database design tool. MySQL Workbench is a powerful tool developed by MySQL with three primary areas of functionality: SQL Development: Replaces MySQL query browser. Allows the user to connect to an existing database and edit and execute SQL queries.Data Modeling: Complete visual database design and modeling.Database Administration: Replaces MySQL administrator. Graphic interface to start/stop servers, create user accounts, edit configuration files, etc. In this tutorial, we’ll focus on the Data Modeling aspect to create a database from scratch, and then have just a quick look at the SQL editor to execute our generated SQL script and create the database within MySQL.

MySQL Workbench is available for Windows, Linux and Mac OSX. It’s time to launch Workbench. And that’s it. 9lessons Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos. Themsaid - Laravel/MySQL JSON documents faster lookup using generated columns. Back to home laravel 5.3 is shipped with built-in support for updating and querying JSON type database fields, the support currently fully covers MySQL 5.7 JSON type fields updates and lookups, this allows us to have the following: DB::table('users')->where('meta->favorite_color', 'red')->get(); This will bring all users who have a favorite color of red, here's a sample table structure: You may also update the field like that: DB::table('users') ->where('id', 1) ->update(['meta->origin' => 'Asshai']); Matt Stauffer wrote up a post about the new features that you can check here.

themsaid - Laravel/MySQL JSON documents faster lookup using generated columns

How to Use JSON Data Fields in MySQL Databases. Export from MySQL Workbench to a Laravel Migration. MySQL Workbench is a cross-platform GPL app that allows you to fully design and document your databases through the app.

Export from MySQL Workbench to a Laravel Migration

Brandon Eckenrode, created a plugin that allows you to export a MySQL Workbench model to Laravel 5 migrations that follow PSR-2 coding standards. When exported, each migration is generated and saved in its own, properly named, migration file. This works by downloading the plugin from GitHub, then open MySQL Workbench and go to the Scripting menu, Install Plugin/Module. GitHub - beckenrode/mysql-workbench-export-laravel-5-migrations: A MySQL Workbench plugin which exports a Model to Laravel 5 Migrations. Mysql - What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? Using MySQL's JSON columns in Laravel 5.3 - Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Using MySQL's JSON columns in Laravel 5.3 -

You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now! Laravel 5.3, which will be released at this years Laracon US, has some new very handy functionality to work with MySQL 5.7 JSON columns. In a post on his site Matt Stauffer demonstrates the new API. While Laravel has had the ability to cast your data to and from JSON since version 5.0, it was previously just a convenience—your data was still just stored in a TEXT field. If you’re going to use this functionality, you should also read Mohamed Said‘s post on how to improve performance by using MySQL generated columns. JSON columns cannot be indexed. Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. MySQL.