Data relation in a single table with ORM / Annotation
Assuming a courses table like this:
create table courses (
course_id int primary key,
course_name char(50)
);
[PHP] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
Data relation in a single table with ORM / Annotation
Assuming a courses table like this:
create table courses (
course_id int primary key,
course_name char(50)
);
***Primero:*** | |
para lograr esa estructura tu variable debe ser un array antes de iniciar la asignación de datos entonces te falta esto, la declaración: | |
$Ibex35=[]; | |
También es importante que comprender que la variable `$numeroEmpresa` debe ser inicializada en 1 ya que no me confirmaste en los comentario como es la estructura numérica, en mi ejemplo iría de la empresa #1 a la #35. | |
entonces yo usaría los siguiente: | |
<?php |
<?php | |
/* | |
Can I write global functions in PHP that share data between them, without also making that data | |
accessible to everyone else? | |
Global functions have a particular utility that is handy, even in an OOP codebase: it doesn't | |
require a fully-qualified class name/use statement and when in the root namespace the function will | |
be automatically resolved from any other namespace automatically (though prepending that slash is |
<?php | |
function highlight_string_ex($string) { | |
static $COLORS = [ | |
"comment" => "\e[32m%s\e[0m", // green | |
"constant" => "\e[93m%s\e[0m", // yellow | |
"function" => "\e[97m%s\e[0m", // white | |
"keyword" => "\e[94m%s\e[0m", // blue | |
"magic" => "\e[93m%s\e[0m", // yellow | |
"string" => "\e[95m%s\e[0m", // magenta |
<?php | |
// Output screenshot: | |
// http://cl.ly/NsqF | |
// ------------------------------------------------------- | |
include_once 'console.php'; | |
// ::log method usage | |
// ------------------------------------------------------- | |
Console::log('Im Red!', 'red'); |
All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Most sections are broken up into two parts: