Obtenemos el id del usuario al que queremos actualizar su rol. Suponemos que el username del usuario es pepe.
SELECT id FROM mdl_user WHERE username LIKE '%pepe%'Salida:
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule . /index.php [L] | |
| </IfModule> | |
| # END WordPress |
| -- Sakila Sample Database Schema | |
| -- Version 1.0 | |
| -- Copyright (c) 2006, 2015, Oracle and/or its affiliates. | |
| -- All rights reserved. | |
| -- Redistribution and use in source and binary forms, with or without | |
| -- modification, are permitted provided that the following conditions are met: | |
| -- * Redistributions of source code must retain the above copyright notice, |
| -- Sakila Sample Database Schema | |
| -- Version 1.0 | |
| -- Copyright (c) 2006, 2015, Oracle and/or its affiliates. | |
| -- All rights reserved. | |
| -- Redistribution and use in source and binary forms, with or without | |
| -- modification, are permitted provided that the following conditions are met: | |
| -- * Redistributions of source code must retain the above copyright notice, |
| http://api.openweathermap.org/data/2.5/weather?q=Almeria&APPID=2e1771d6989168058859fdd4b1b30d89 |
| FROM ubuntu | |
| LABEL title="soldat" \ | |
| author="José Juan Sánchez" | |
| RUN dpkg --add-architecture i386 \ | |
| && apt-get update \ | |
| && apt-get install -y libc6:i386 \ | |
| && apt-get install -y libstdc++6:i386 \ | |
| && apt-get install -y wget \ |
| DROP DATABASE IF EXISTS tienda; | |
| CREATE DATABASE tienda CHARACTER SET utf8mb4; | |
| USE tienda; | |
| CREATE TABLE usuario ( | |
| id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | |
| email VARCHAR(50) NOT NULL UNIQUE, | |
| password VARCHAR(128) NOT NULL, | |
| nombre VARCHAR(128) NOT NULL | |
| ); |
| DROP DATABASE IF EXISTS universidad; | |
| CREATE DATABASE universidad CHARACTER SET utf8mb4; | |
| USE universidad; | |
| CREATE TABLE departamento ( | |
| id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | |
| nombre VARCHAR(50) NOT NULL | |
| ); | |
| CREATE TABLE persona ( |
| DROP DATABASE IF EXISTS jardineria; | |
| CREATE DATABASE jardineria CHARACTER SET utf8mb4; | |
| USE jardineria; | |
| CREATE TABLE oficina ( | |
| codigo_oficina VARCHAR(10) NOT NULL, | |
| ciudad VARCHAR(30) NOT NULL, | |
| pais VARCHAR(50) NOT NULL, | |
| region VARCHAR(50) DEFAULT NULL, | |
| codigo_postal VARCHAR(10) NOT NULL, |
| #!/bin/bash | |
| # Credenciales de Telegram | |
| TOKEN="" | |
| CHATID="" | |
| # API de Telegram | |
| URL="https://api.telegram.org/bot$TOKEN/sendMessage" | |