Acerca de Linux, BSD y notas personales

Archives for Programación category

FORTRAN WIKI

http://en.wikibooks.org/wiki/Fortran

Hide intro text joomla

Hide Intro Text
we usually set the defaults in the relevant XML files for the user to make it easier when they are adding and editing new content. Like you, we often find we’re wanting Hide intro text on by default. So, instead of setting it globally we edit
administrator/components/com_content/content.xml

change line 28 where it says

Search and Reemplace

 update esalud_content set introtext = replace(introtext,CONVERT( _utf8 ‘%{ }%’ USING latin1 ),’ ‘)

moseasymedia

{moseasymedia media=/consulta/banner.swf height=195 width=170}

AUTO_INCREMENT

El valor inicial para AUTO_INCREMENT para la tabla. En MySQL 5.0, sólo funciona para tablas MyISAM y MEMORY. También se soporta para InnoDB desde MySQL 5.0.3. Para inicializar el primer valor de auto incremento para motores que no soporten esta opción, inserte un registro de prueba con un valor que sea uno menor al deseado tras crear la tabla, y luego borre este registro.

Para motores que soportan la opción de tabla AUTO_INCREMENT en comandos CREATE TABLE puede usar ALTER TABLE tbl_name AUTO_INCREMENT = n para resetear el valor AUTO_INCREMENT .

SELECT LAST_INSERT_ID();

what the fuck??!! Amor en PHP ?

Phplove

“Si me quieres, te querré
más y más a cada instante mientras viva
porque si no me quieres no soy nada”

Phpdeseo

“Mi esperanza es ser parte de tu vida
y que tú seas parte de la mía.”

Tags: ,

ALTER TABLE ORDERS FOREIGN KEY

MySQL:
CREATE TABLE ORDERS
(Order_ID integer,
Order_Date date,
Customer_SID integer,
Amount double,
Primary Key (Order_ID),
Foreign Key (Customer_SID) references CUSTOMER(SID));

Oracle:
CREATE TABLE ORDERS
(Order_ID integer primary key,
Order_Date date,
Customer_SID integer references CUSTOMER(SID),
Amount double);

SQL Server:
CREATE TABLE ORDERS
(Order_ID integer primary key,
Order_Date datetime,
Customer_SID integer references CUSTOMER(SID),
Amount double);

Below are examples for specifying a foreign key by altering a table. This assumes that the ORDERS table has been created, and the foreign key has not yet been put in:

MySQL:
ALTER TABLE ORDERS
ADD FOREIGN KEY (customer_sid) REFERENCES CUSTOMER(SID);

Oracle:
ALTER TABLE ORDERS
ADD (CONSTRAINT fk_orders1) FOREIGN KEY (customer_sid) REFERENCES CUSTOMER(SID);

SQL Server:
ALTER TABLE ORDERS
ADD FOREIGN KEY (customer_sid) REFERENCES CUSTOMER(SID);

MySQL migration: MyISAM to InnoDB

 

By Keith Winston on July 18, 2005 (8:00:00 AM)

The MySQL database is unique in that it offers multiple storage engines. The SQL parser and front end interfaces are separate from the storage engines, so you can choose among nine low-level table formats the one that suits your application best. I recently needed to convert a production application from the default indexed sequential format, MyISAM, to InnoDB. Here’s my no-hassle guide to performing the conversion.

Read more… »

What is referential integrity?

 

Simply put, referential integrity means that when a record in a table refers to a corresponding record in another table, that corresponding record will exist. Look at the following:

Read more… »

MySQL search and replace

update tablename set field = replace(field,'search_for_this','replace_with_this');