* @description Basado en un viejo script de Clipper que realice para llenar tablas. * * @version 0.3ß * @param bd string Nombre de la base de datos * @param t string Nombre de la Tabla de la Base de datos * @param h string Host * @param cant int Cantidad de registros a ingresar * @param kill string Si borra o no la tabla antes de cargar datos (S/N) * @example ?bd=pruebas&t=contenidos&cant=100&kill=S * @return nothing * @access public * * @update 24/11/2007 14:02 0.6ß Cambio DELETE x TRUNCATE para que inicialice los IDs * @update 11/07/2007 18:00 0.5ß Agrego el max_execution_time y parametro h para host por default localhost * @28/06/2007 10:23 0.4ß Agrego campo avatar y email * @update 18/10/06 - 14:30:20 0.1ß Solo soporte de Lorem Ipsum * @update 20/10/2006 16:53 0.2ß Soporte para textos aleatorios entre "lorem", "cicero", "mumbo", "shakespeare" * @update 17/05/2007 0.3ß Soporte de Timestamp y campos comunes (audio, video, tags, *IP, url) */ ini_set('max_execution_time', 300); # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_cnx = ( isset($_GET['h']) )?$_GET['h']:"localhost"; $database_cnx = $_GET['bd']; $username_cnx = ( isset($_GET['u']) )?$_GET['u']:"root"; $password_cnx = ( isset($_GET['p']) )?$_GET['p']:""; $cnx = mysql_pconnect($hostname_cnx, $username_cnx, $password_cnx) or trigger_error(mysql_error(),E_USER_ERROR); ?> $row['Field'], "tipo"=>$esKEY.$row['Type'] ); $camposNombres.=$row['Field'].","; } $camposNombres=substr( $camposNombres, 0, strlen($camposNombres)-1); // Borro tabla if ( isset( $_GET['kill'] ) && $_GET['kill'] =="S") { mysql_select_db($database_cnx, $cnx); // $rs = mysql_query("delete from ".$tabla, $cnx) or die(mysql_error()); $rs = mysql_query("TRUNCATE ".$tabla, $cnx) or die(mysql_error()); } # Paso 2: Cargar Datos temporales for ($i=0;$i<$cantidad;$i++) { $valores=""; for ( $j=0; $j".var_dump($camposTipos)); } echo sprintf( "Basural 0.1ß
Se procesaron [%s] registros para [%s].[%s]", $cantidad, $database_cnx ,$tabla); function lipsum( $palabras ) { $lorem = Array("Lorem ipsum dolor sit amet,", "consectetur adipisicing elit,", "sed do eiusmod tempor incididunt", "ut labore et dolore magna aliqua.", "Ut enim ad minim veniam,", "quis nostrud exercitation", "ullamco laboris nisi", "ut aliquip ex ea commodo consequat.", "Duis aute irure dolor", "in reprehenderit in voluptate", "velit esse cillum dolore", "eu fugiat nulla pariatur.", "Excepteur sint occaecat", "cupidatat non proident,", "sunt in culpa", "qui officia deserunt", "mollit anim id est laborum."); $cicero = Array("Sed ut perspiciatis unde omnis", "iste natus error sit voluptatem", "accusantium doloremque laudantium,", "totam rem aperiam,", "eaque ipsa quae ab illo inventore veritatis", "et quasi architecto beatae vitae", "dicta sunt explicabo.", "Nemo enim ipsam voluptatem", "quia voluptas sit aspernatur", "aut odit aut fugit,", "sed quia consequuntur magni dolores eos", "qui ratione voluptatem sequi nesciunt.", "Neque porro quisquam est,", "qui dolorem ipsum quia dolor sit amet,", "consectetur, adipisci velit,", "sed quia non numquam eius modi", "tempora incidunt ut labore et dolore", "magnam aliquam quaerat voluptatem.", "Ut enim ad minima veniam,", "quis nostrum exercitationem", "ullam corporis suscipit laboriosam,", "nisi ut aliquid ex ea commodi consequatur?", "Quis autem vel eum iure reprehenderit", "qui in ea voluptate", "velit esse quam nihil molestiae consequatur,", "vel illum qui dolorem eum fugiat", "quo voluptas nulla pariatur?" ,"At vero eos et accusamus et iusto odio", "dignissimos ducimus qui blanditiis", "praesentium voluptatum deleniti", "atque corrupti quos dolores et quas molestias", "excepturi sint occaecati cupiditate non provident,", "similique sunt in culpa qui officia deserunt mollitia animi,", "id est laborum et dolorum fuga.", "Et harum quidem rerum facilis est", "et expedita distinctio.", "Nam libero tempore,", "cum soluta nobis est eligendi optio", "cumque nihil impedit quo minus", "id quod maxime placeat facere possimus,", "omnis voluptas assumenda est,", "omnis dolor repellendus.", "Temporibus autem quibusdam", "et aut officiis debitis aut rerum necessitatibus", "saepe eveniet ut et voluptates repudiandae sint", "et molestiae non recusandae.", "Itaque earum rerum hic tenetur a sapiente delectus,", "ut aut reiciendis voluptatibus maiores alias", "consequatur aut perferendis doloribus asperiores repellat." ); $mumbo = Array("Working through a top-down, bottom-up approach,", "the vitality of conceptual synergies is of supreme importance", "building a dynamic relationship between the main players.", "Quantitative analysis of all the key ratios has a vital role to play in this", "in a collaborative, forward-thinking venture brought together through the merging of like minds.", "highly motivated participants contributing to a valued-added outcome.", "Benchmarking against industry leaders, an essential process, should be a top priority at all times", "to ensure that non-operating cash outflows are assessed.", "through the adoption of a proactive stance, the astute manager can adopt a position at the vanguard.", "taking full cognizance of organizational learning parameters and principles,", "combined with optimal use of human resources,", "That will indubitably lay the firm foundations for any leading company", "to experience a profound paradigm shift,", "Presentation of the process flow should culminate in idea generation,", "motivating participants and capturing their expectations,", "in order to build a shared view of what can be improved,", "The strategic vision - if indeed there be one - is required to identify", "the components and priorities for the change program", "Whether the organization's core competences are fully in line, given market realities", "to focus on improvement, not cost,", "exploiting the productive lifecycle", "From binary cause and effect to complex patterns,", "building flexibility through spreading knowledge and self-organization,", "Organizations capable of double-loop learning,", "as knowledge is fragmented into specialities", "while those at the coal face don't have sufficient view of the overall goals.", "The balanced scorecard, like the executive dashboard, is an essential tool", "by moving executive focus from lag financial indicators to more actionable lead indicators,", "measure the process, not the people.","exploitation of core competencies as an essential enabler,", "The three Cs - customers, competition and change - have created a new world for business", "Big is no longer impregnable", "an important ingredient of business process reengineering", "The new golden rule gives enormous power to those individuals and units,", "Whenever single-loop learning strategies go wrong,", "defensive reasoning, the doom loop and doom zoom", "empowerment of all personnel, not just key operatives,", "by adopting project appraisal through incremental cash flow analysis,", "maximization of shareholder wealth through separation of ownership from management", "an investment program where cash flows exactly match shareholders' preferred time patterns of consumption"); $shakespeare = Array("Let me not to the marriage of true minds", "Admit impediments; love is not love", "Which alters when it alteration finds,", "Or bends with the remover to remove.", "Oh, no, it is an ever fixed mark", "That looks on tempests and is never shaken;", "It is the star to every wand'ring bark,", "Whose worth's unknown, although his height be taken.", "Love's not Time's fool, though rosy lips and cheeks", "Within his bending sickle's compass come;", "Love alters not with his brief hours and weeks,", "But bears it out even to the edge of Doom.", "If this be error and upon me proved,", "I never writ, nor no man ever loved."); shuffle( $lorem ); shuffle( $cicero ); shuffle( $mumbo ); shuffle( $shakespeare ); $textos=array("lorem", "cicero", "mumbo", "shakespeare" ); $elijo=rand( 1, count( $textos )-1 ) ; $declaracion=$textos[$elijo]; $cad="\$".$declaracion; eval( "\$texto=$cad;"); $popurri=""; for ( $i=0; $i