<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ayuda con tus Tareas &#187; Programación</title>
	<atom:link href="http://ayuda.fotopex.com/category/programacion/feed/" rel="self" type="application/rss+xml" />
	<link>http://ayuda.fotopex.com</link>
	<description>En forma fácil</description>
	<lastBuildDate>Fri, 19 Mar 2010 16:07:00 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Solución error SQL_BIG_SELECTS</title>
		<link>http://ayuda.fotopex.com/programacion/bases-de-datos/solucion-error-sql_big_selects/</link>
		<comments>http://ayuda.fotopex.com/programacion/bases-de-datos/solucion-error-sql_big_selects/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 21:03:50 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[Bases de Datos]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[SQL_BIG_SELECTS]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=749</guid>
		<description><![CDATA[El problema viene porque estas cargando una consulta que MySqL considera que puede ser grande ó se hacen bastantes relaciones entre las tablas.
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
Ese error es debido a la variable de MySQL SQL_BIG_SELECTS, y [...]]]></description>
			<content:encoded><![CDATA[<p>El problema viene porque estas cargando una consulta que MySqL considera que puede ser grande ó se hacen bastantes relaciones entre las tablas.</p>
<blockquote><p>The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay</p></blockquote>
<p>Ese error es debido a la variable de MySQL SQL_BIG_SELECTS, y en el mensaje mismo te indica la respuesta:</p>
<blockquote><p><strong>SELECT</strong> examinará más de <strong>MAX_JOIN_SIZE</strong> filas, revisa tu <strong>WHERE</strong> y usa <strong><em>SET SQL_BIG_SELECTS = 1</em></strong> o <strong>SET SQL_MAX_JOIN_SIZE = #</strong> si el SELECT está bien.
</p></blockquote>
<p><span id="more-749"></span></p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>Así que antes de correr tu consulta debes indicar al MySQL que permita el uso de consultas extendidas, para eso hay que ejecutar el siguiente query con la variable <strong>SQL_BIG_SELECTS</strong>:</p>
<blockquote><p>mysql_query("set sql_big_selects=1");</p></blockquote>
<div style="clear:both;"></div>
<p>Ejemplo:</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_query" target="_blank"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'SQL_BIG_SELECTS=1'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// aquí ampliamos la consulta</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$Ssql</span> = <span style="color:#FF0000;">'SELECT .... FROM ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">INNER JOIN&nbsp; ...</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">INNER JOIN&nbsp; ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">WHERE ....</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">AND ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">ORDER BY ...'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$result</span> = <a href="http://www.php.net/mysql_query" target="_blank"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$Ssql</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>SQL_BIG_SELECTS = {0 | 1}</strong></p>
<p>Con valor 0, MySQL aborta los comandos SELECT que probablemente tardarán mucho tiempo (esto es, comandos para los que el optimizador estima que el número de registros examinados excede el valor de max_join_size). Esto es útil cuando un comando WHERE no aconsejable se ejecuta. El valor por defecto para una nueva conexión es 1, que permite todos los comandos SELECT .</p>
<p>Si cambia la variable de sistema max_join_size a un valor distinto a DEFAULT, SQL_BIG_SELECTS se pone a 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/bases-de-datos/solucion-error-sql_big_selects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Escribir datos de un OleDbDataReader a un archivo de texto</title>
		<link>http://ayuda.fotopex.com/programacion/net/escribir-datos-de-un-oledbdatareader-a-un-archivo-de-texto/</link>
		<comments>http://ayuda.fotopex.com/programacion/net/escribir-datos-de-un-oledbdatareader-a-un-archivo-de-texto/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 23:46:01 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Archivos]]></category>
		<category><![CDATA[Tabla]]></category>
		<category><![CDATA[Texto]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=744</guid>
		<description><![CDATA[OleDbDataReader proporciona el modo de lectura de una secuencia de filas de datos de tipo sólo avance de un origen de datos. Esta clase no se puede heredar. 
Para crear OleDbDataReader, se debe llamar al método ExecuteReader del objeto OleDbCommand, en lugar de utilizar directamente un constructor.
Mientras se está utilizando OleDbDataReader, el objeto OleDbConnection asociado [...]]]></description>
			<content:encoded><![CDATA[<p><strong>OleDbDataReader</strong> proporciona el modo de lectura de una secuencia de filas de datos de tipo sólo avance de un origen de datos. Esta clase no se puede heredar. </p>
<p>Para crear OleDbDataReader, se debe llamar al método ExecuteReader del objeto OleDbCommand, en lugar de utilizar directamente un constructor.</p>
<p>Mientras se está utilizando OleDbDataReader, el objeto OleDbConnection asociado está ocupado dando servicio a OleDbDataReader, y en OleDbConnection no se puede realizar ninguna otra operación, excepto la de cerrar. Esto es así hasta que se llama al método Close de OleDbDataReader. Por ejemplo, <span id="more-744"></span>no se pueden recuperar parámetros de salida hasta después de llamar a Close.</p>
<p>Los cambios que realiza otro proceso o subproceso en un conjunto de resultados mientras se leen los datos, pueden ser visibles para el usuario de OleDbDataReader. Sin embargo, el comportamiento exacto depende de los intervalos de tiempo.</p>
<p>IsClosed y RecordsAffected son las únicas propiedades a las que se puede llamar después de cerrarse OleDbDataReader. Si bien se puede obtener acceso a la propiedad RecordsAffected mientras exista OleDbDataReader, se debe llamar siempre al método Close antes de devolver el valor de RecordsAffected para garantizar que el valor devuelto sea exacto.</p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>En el siguiente ejemplo se crean OleDbConnection, OleDbCommand y OleDbDataReader. En el ejemplo se leen los datos y se escriben en la consola. Por último, en el ejemplo se cierra OleDbDataReader y, a continuación, OleDbConnection.</p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lvbnet-5"><a href="#" onclick="javascript:showPlainTxt('vbnet-5'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">VB.NET:</span>
<div id="vbnet-5">
<div class="vbnet">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Sub</span> ReadData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> connectionString <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> = <span style="color: #808080;">"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\FotoPex\FpTimer\data\data.mdb"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> queryString <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> = <span style="color: #808080;">"SELECT usuario, Format(entrada, 'hh:mm:ss') as Entrada, Format(salida, 'hh:mm:ss') as Salida FROM(bitacora) WHERE (((fecha)=#03/04/2010#)) Order by id DESC ;"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Using connection <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> OleDbConnection<span style="color: #000000;">&#40;</span>connectionString<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> <span style="color: #0600FF;">command</span> <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> OleDbCommand<span style="color: #000000;">&#40;</span>queryString, connection<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; connection.<span style="color: #0600FF;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> reader <span style="color: #FF8000;">As</span> OleDbDataReader = <span style="color: #0600FF;">command</span>.<span style="color: #0000FF;">ExecuteReader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">While</span> reader.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>reader<span style="color: #000000;">&#40;</span><span style="color: #FF0000;color:#800000;">0</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">While</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; reader.<span style="color: #0600FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">End</span> Using</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora vamos a ver una variante del ejemplo para <a href="http://ayuda.fotopex.com/programacion/net/escribir-datos-de-una-tabla-a-un-archivo-de-texto/">escribir datos de una tabla a un archivo de texto</a>, pero esta vez utilizaremos un OleDbDataReader para obtener los datos. No olvidemos declarar el NameSpace <strong>Imports System.IO</strong></p>
<div class="igBar"><span id="lvbnet-6"><a href="#" onclick="javascript:showPlainTxt('vbnet-6'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">VB.NET:</span>
<div id="vbnet-6">
<div class="vbnet">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> GrabaArchivo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> cn <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> OleDbConnection<span style="color: #000000;">&#40;</span><span style="color: #808080;">"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\FotoPex\FpTimer\data\data.mdb"</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> sql <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Try</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' preparamos el archivo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> Bitacora <span style="color: #FF8000;">As</span> StreamWriter</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> NuevaLinea <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> = <span style="color: #808080;">""</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> newFileName <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> = BitacoraPath &amp; <span style="color: #FF0000;">Date</span>.<span style="color: #0600FF;">Today</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"MMM dd yyyy"</span><span style="color: #000000;">&#41;</span> &amp; <span style="color: #808080;">".txt"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' verificamos si existe</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> <a href="http://www.google.com/search?q=FILE+msdn.microsoft.com"><span style="color: #008000;">File</span></a>.<span style="color: #0000FF;">Exists</span><span style="color: #000000;">&#40;</span>newFileName<span style="color: #000000;">&#41;</span> = <span style="color: #0600FF;">False</span> <span style="color: #FF8000;">Then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' lo creamos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Bitacora = <a href="http://www.google.com/search?q=FILE+msdn.microsoft.com"><span style="color: #008000;">File</span></a>.<span style="color: #0000FF;">CreateText</span><span style="color: #000000;">&#40;</span>newFileName<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' lo abrimos para agregar texto</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Bitacora = <a href="http://www.google.com/search?q=FILE+msdn.microsoft.com"><span style="color: #008000;">File</span></a>.<span style="color: #0000FF;">AppendText</span><span style="color: #000000;">&#40;</span>newFileName<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; NuevaLinea = <span style="color: #808080;">"Time: "</span> &amp; <span style="color: #FF0000;">Date</span>.<span style="color: #0600FF;">Now</span>.<span style="color: #0000FF;">ToShortTimeString</span> &amp; vbCrLf &amp; _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #808080;">"Usuario"</span> &amp; vbTab &amp; <span style="color: #808080;">"&nbsp; Entrada&nbsp; "</span> &amp; vbTab &amp; <span style="color: #808080;">"&nbsp; Salida&nbsp; "</span> &amp; vbTab &amp; <span style="color: #808080;">"Total"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">'agregamos datos al buffer en una linea nueva</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; Bitacora.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>NuevaLinea<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' buscamos los resultados</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; cn.<span style="color: #0600FF;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' por otro carácter</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; sql = <span style="color: #808080;">"SELECT usuario, Format(entrada, 'hh:mm:ss') as Entrada, Format(salida, 'hh:mm:ss') as Salida FROM(bitacora) WHERE (((fecha)=#03/04/2010#)) Order by id DESC ;"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">'creamos un comando</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> cmd <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> OleDbCommand<span style="color: #000000;">&#40;</span>sql, cn<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> dr <span style="color: #FF8000;">As</span> OleDbDataReader = cmd.<span style="color: #0000FF;">ExecuteReader</span><span style="color: #000000;">&#40;</span>CommandBehavior.<span style="color: #0000FF;">CloseConnection</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Do</span> <span style="color: #0600FF;">While</span> dr.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; NuevaLinea = dr.<span style="color: #0000FF;">Item</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"usuario"</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span> &amp; vbTab &amp; dr.<span style="color: #0000FF;">Item</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"Entrada"</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span> &amp; vbTab &amp; dr.<span style="color: #0000FF;">Item</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"Salida"</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span> &amp; vbTab &amp; <span style="color: #808080;">"Total"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Bitacora.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>NuevaLinea<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">' limpiamos el buffer y escribimos los datos contenidos al stream</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Bitacora.<span style="color: #0000FF;">Flush</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Loop</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; NuevaLinea = vbCrLf &amp; <span style="color: #808080;">"********************* ***** "</span> &amp; vbCrLf</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; Bitacora.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>NuevaLinea<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; Bitacora.<span style="color: #0000FF;">Flush</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; Bitacora.<span style="color: #0600FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008080; font-style: italic;">' no olvides cerrar el archivo</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; dr.<span style="color: #0600FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">'mostramos el error</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> <a href="http://www.google.com/search?q=ERR+msdn.microsoft.com"><span style="color: #008000;">Err</span></a>.<span style="color: #0000FF;">Number</span> = <span style="color: #FF0000;color:#800000;">91</span> Or <a href="http://www.google.com/search?q=ERR+msdn.microsoft.com"><span style="color: #008000;">Err</span></a>.<span style="color: #0000FF;">Number</span> = <span style="color: #FF0000;color:#800000;">5</span> <span style="color: #FF8000;">Then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">'MessageBox.Show(&quot;No se encontro registro&quot;)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=ERR+msdn.microsoft.com"><span style="color: #008000;">Err</span></a>.<span style="color: #0000FF;">Clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; MessageBox.<span style="color: #0000FF;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"error "</span> &amp; <a href="http://www.google.com/search?q=ERR+msdn.microsoft.com"><span style="color: #008000;">Err</span></a>.<span style="color: #0000FF;">Number</span>.<span style="color: #0000FF;">ToString</span> &amp; vbCrLf &amp; ex.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">'Finally</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Try</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/net/escribir-datos-de-un-oledbdatareader-a-un-archivo-de-texto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clausula LIMIT en Access, SQL, MySQL y ORACLE</title>
		<link>http://ayuda.fotopex.com/programacion/bases-de-datos/clausula-limit-en-access-sql-mysql-y-oracle/</link>
		<comments>http://ayuda.fotopex.com/programacion/bases-de-datos/clausula-limit-en-access-sql-mysql-y-oracle/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 18:53:38 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[Bases de Datos]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[consulta]]></category>
		<category><![CDATA[LIMIT]]></category>
		<category><![CDATA[limitar]]></category>
		<category><![CDATA[MySQL y ORACLE]]></category>
		<category><![CDATA[registros]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=741</guid>
		<description><![CDATA[
 




Para limitar el número de registros que debe devolver una consulta podemos utilizar:
Para Access y MS SQL utilizaremos TOP n de esa forma obtendremos los n primeros resultados de la búsqueda, y si nos interesa son los n últimos, utilizaremos  la cláusula ORDER BY

Texto Plano
SQL:




SELECT TOP n ... FROM ...


WHERE ...


ORDER BY... 






Para [...]]]></description>
			<content:encoded><![CDATA[<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>Para limitar el número de registros que debe devolver una consulta podemos utilizar:</p>
<p>Para <strong>Access</strong> y MS SQL utilizaremos <strong>TOP n</strong> de esa forma obtendremos los n primeros resultados de la búsqueda, y si nos interesa son los n últimos, utilizaremos  la cláusula <strong>ORDER BY</strong></p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lsql-11"><a href="#" onclick="javascript:showPlainTxt('sql-11'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-11">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> TOP n ... <span style="color: #993333; font-weight: bold;">FROM</span> ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span>... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para <strong>MySQL</strong> utilizaremos <strong>LIMIT n </strong>, que ademas permite el compaginado agregando al final de un <strong>SELECT</strong>la clausula "<strong>LIMIT</strong>".<br />
<strong>MySQL</strong> - <strong>LIMIT n </strong></p>
<div class="igBar"><span id="lmysql-12"><a href="#" onclick="javascript:showPlainTxt('mysql-12'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">MySQL:</span>
<div id="mysql-12">
<div class="mysql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> ... <span style="color: #993333; font-weight: bold;">FROM</span> ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">LIMIT n, n </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para ver cinco registros a partir del registro 10:</p>
<div class="igBar"><span id="lsql-13"><a href="#" onclick="javascript:showPlainTxt('sql-13'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-13">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> tabla <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;color:#800000;">10</span>,<span style="color: #cc66cc;color:#800000;">5</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>ORACLE</strong> genera una variable, tal y como si fuera un campo más de cada registro de la tabla, llamada “rownum”, la cual se incrementa por cada registro que vamos recuperando. De esta manera, sólo tenemos que acceder a esta variable y controlar que no sobrepasa el número que nos hemos propuesto como límite.</p>
<div class="igBar"><span id="loracle8-14"><a href="#" onclick="javascript:showPlainTxt('oracle8-14'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">ORACLE8:</span>
<div id="oracle8-14">
<div class="oracle8">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> campos</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">WHERE</span> condicion</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">AND</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROWNUM</span> &lt;= <span style="color: #cc66cc;color:#800000;">2</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/bases-de-datos/clausula-limit-en-access-sql-mysql-y-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SHA-1 Con VB.NET 2008</title>
		<link>http://ayuda.fotopex.com/programacion/net/sha-1-con-vb-net-2008/</link>
		<comments>http://ayuda.fotopex.com/programacion/net/sha-1-con-vb-net-2008/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 01:50:18 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=731</guid>
		<description><![CDATA[

 




Necesitamos :
1 caja de texto TextBox1
1 botón Button1
1 etiqueta para el mensaje lblMsg
Ya sabes que puedes bajarte los archivos sha1 con vb.net


Texto Plano
VB.NET:




Imports System.Security.Cryptography


Imports System.Text


&#160;


Public Class Form1 


&#160; Private Function generarClaveSHA1&#40;ByVal nombre As String&#41; As String


&#160; &#160; Dim enc As New UTF8Encoding


&#160; &#160; Dim data&#40;&#41; As Byte = enc.GetBytes&#40;nombre&#41;


&#160; &#160; Dim result&#40;&#41; As Byte


&#160;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/03/sha1-small.jpg" alt="" title="sha1-small" width="550" height="189" class="aligncenter size-full wp-image-732" /></p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>Necesitamos :</p>
<p>1 caja de texto <strong>TextBox1</strong><br />
1 botón <strong>Button1</strong><br />
1 etiqueta para el mensaje <strong>lblMsg</strong></p>
<p>Ya sabes que puedes bajarte los archivos <a href='http://ayuda.fotopex.com/wp-content/uploads/2010/03/sha1.zip'>sha1 con vb.net</a></p>
<div style="clear:both;"></div>
<p><span id="more-731"></span></p>
<div class="igBar"><span id="lvbnet-16"><a href="#" onclick="javascript:showPlainTxt('vbnet-16'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">VB.NET:</span>
<div id="vbnet-16">
<div class="vbnet">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Security</span>.<span style="color: #0000FF;">Cryptography</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Text</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #FF8000;">Public</span> <span style="color: #0600FF;">Class</span> Form1 </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> generarClaveSHA1<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> nombre <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> enc <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> UTF8Encoding</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> data<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Byte</span> = enc.<span style="color: #0000FF;">GetBytes</span><span style="color: #000000;">&#40;</span>nombre<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> result<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Byte</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> sha <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> SHA1CryptoServiceProvider<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; result = sha.<span style="color: #0000FF;">ComputeHash</span><span style="color: #000000;">&#40;</span>data<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> sb <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> StringBuilder</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #FF8000;">For</span> i <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span> = <span style="color: #FF0000;color:#800000;">0</span> <span style="color: #FF8000;">To</span> result.<span style="color: #0000FF;">Length</span> - <span style="color: #FF0000;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> result<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span> &lt;<span style="color: #FF0000;color:#800000;">16</span> <span style="color: #FF8000;">Then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; sb.<span style="color: #0000FF;">Append</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"0"</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; sb.<span style="color: #0000FF;">Append</span><span style="color: #000000;">&#40;</span>result<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"x"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #FF8000;">Next</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Return sb.<span style="color: #0000FF;">ToString</span>.<span style="color: #0000FF;">ToUpper</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> Button1_Click<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> Button1.<span style="color: #0000FF;">Click</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">lblMsg</span>.<span style="color: #0000FF;">Text</span> = generarClaveSHA1<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">TextBox1</span>.<span style="color: #0000FF;">Text</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Class</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/net/sha-1-con-vb-net-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color del texto seleccionado con CSS</title>
		<link>http://ayuda.fotopex.com/programacion/internet/color-del-texto-seleccionado-con-css/</link>
		<comments>http://ayuda.fotopex.com/programacion/internet/color-del-texto-seleccionado-con-css/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 15:27:58 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=720</guid>
		<description><![CDATA[
Algo tan simple como:
Texto Plano
CSS:




::-moz-selection &#123;background:#FF0000; color:#000;&#125;


::selection &#123;background:#FF0000; color:#000;&#125; 






Pero si usas Internet Explorer no funciona.


 





]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/02/texto-css-fotopex-490x304.jpg" alt="" title="texto-css-fotopex" width="490" height="304" class="aligncenter size-medium wp-image-721" /><br />
Algo tan simple como:</p>
<div class="igBar"><span id="lcss-18"><a href="#" onclick="javascript:showPlainTxt('css-18'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-18">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:<span style="color: #3333ff;">:-moz-selection </span><span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span>:#FF0000; <span style="color: #000000; font-weight: bold;">color</span>:#000;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:<span style="color: #3333ff;">:selection </span><span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span>:#FF0000; <span style="color: #000000; font-weight: bold;">color</span>:#000;<span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Pero si usas Internet Explorer no funciona.<br />
<span id="more-720"></span>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div style="clear:both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/internet/color-del-texto-seleccionado-con-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reCAPTCHA con PHP</title>
		<link>http://ayuda.fotopex.com/programacion/php/recaptcha-con-php/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/recaptcha-con-php/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 16:29:57 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[reCAPTCHA]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=717</guid>
		<description><![CDATA[reCAPTCHA es un servicio gratuito que permite incluir validación a los formularios mediante un CAPTCHA (imagen con texto distorsionado) para garantizar que sólo los seres humanos realizar ciertas acciones con el fin de prevenir el abuso automático de tu sitio por ejemplo, los comentarios no deseados o los registros falsos. Además sirve para digitalizar libros [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2010/02/recaptcha.jpg" alt="" title="recaptcha" width="275" height="254" class="alignleft size-full wp-image-718" /><strong>reCAPTCHA </strong>es un servicio gratuito que permite incluir validación a los formularios mediante un CAPTCHA (imagen con texto distorsionado) para garantizar que sólo los seres humanos realizar ciertas acciones con el fin de prevenir el abuso automático de tu sitio por ejemplo, los comentarios no deseados o los registros falsos. Además sirve para digitalizar libros pues reCAPTCHA muestras dos palabras una para verificar el captcha y la otra que no ha sido reconocida y que nosotros la reconoceremos.</p>
<p>Para utilizar el servicio debes registrarte y obtener los códigos de validación que vamos a utilizar en nuestro proyecto: <strong>Public Key</strong> y <strong>Private Key</strong>.<span id="more-717"></span></p>
<div style="padding: 5px; float: right; " >
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<p>El primer paso después de registrarnos es descargar el archivo <strong>ReCaptcha-php-1.10.zip</strong> el cual contiene el archivo <strong>recaptchalib.php</strong> con los métodos necesarios para el uso de reCAPTCHA.</p>
<p>Ahora vamos a incluir en el formulario el archivo recaptchalib.php y agregamos variables con los valores de nuestros keys obtenidos.</p>
<div style="clear:both;"></div>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'recaptchalib.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$publickey</span> = <span style="color:#FF0000;">"6vAA4AoAAAAFAOoJAAAYRlAfArE-_zv6XrAUAjAkj"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$privatekey</span> = <span style="color:#FF0000;">"6vAA4AoAAFAAAF1AAVwAABvAtvdhSx5ACAxUAjAkj"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$error</span> = <span style="color:#000000; font-weight:bold;">null</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora vamos a mostrar el captcha con la función <strong>recaptcha_get_html</strong>.</p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showPlainTxt('php-23'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;form method=<span style="color:#FF0000;">"post"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;label <span style="color:#616100;">for</span>=<span style="color:#FF0000;">"usuario"</span>&gt;Usuario&lt;/label&gt;&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;input name=<span style="color:#FF0000;">"usuario"</span> type=<span style="color:#FF0000;">"text"</span> id=<span style="color:#FF0000;">"usuario"</span> /&gt;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;label <span style="color:#616100;">for</span>=<span style="color:#FF0000;">"email"</span>&gt;Email&lt;/label&gt;&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;input name=<span style="color:#FF0000;">"email"</span> type=<span style="color:#FF0000;">"text"</span> id=<span style="color:#FF0000;">"email"</span> /&gt;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;label <span style="color:#616100;">for</span>=<span style="color:#FF0000;">"usercheck"</span>&gt;Verificaci&amp;oacute;n&lt;/label&gt;&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> recaptcha_get_html<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$publickey</span>, <span style="color:#0000FF;">$error</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;input type=<span style="color:#FF0000;">"hidden"</span> name=<span style="color:#FF0000;">"accion"</span> value=<span style="color:#FF0000;">"registrar"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span style="color:#FF0000;">"submit"</span> name=<span style="color:#FF0000;">"btnenviar"</span> value=<span style="color:#FF0000;">"Enviar"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;/form&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cuando el formulario se ha enviado procedemos a verificar que el texto de captcha se ha ingresado correctamente ó mostramos un mensaje de error.</p>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'accion'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#FF0000;">"registrar"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$re_ip</span> = <span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"REMOTE_ADDR"</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$re_challenge</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"recaptcha_challenge_field"</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$re_response</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">"recaptcha_response_field"</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$re_valid</span> = recaptcha_check_answer<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$privatekey</span>, <span style="color:#0000FF;">$re_ip</span>, <span style="color:#0000FF;">$re_challenge</span>, <span style="color:#0000FF;">$re_response</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$re_valid</span>-&gt;<span style="color:#006600;">is_valid</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">// procesar registro</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'aquí van los procesos'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$error</span> = <span style="color:#0000FF;">$resp</span>-&gt;<span style="color:#006600;">error</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora puedes ayudar a tu sitio web y quitarle de encima tanto SPAM, te dejo el enlace de reCAPTCHA para registrarte y bajarte el archivo <a href="http://recaptcha.net/" target="_blank">ReCaptcha-php-1.10.zip</a>.</p>
<p>Tambien puedes utilizar alguna de las librerías que ofrecen para ASP.NET, Python, Perl, etc. o utilizar directamente el API.</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/recaptcha-con-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convertir texto en un array</title>
		<link>http://ayuda.fotopex.com/programacion/php/convertir-texto-en-un-array/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/convertir-texto-en-un-array/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 13:03:18 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[coma]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=693</guid>
		<description><![CDATA[Cuando mostramos cómo hacer una nube de etiquetas , también vimos un ejemplo de como utilizar la instrucción explode.
&#160;

 




Texto Plano
PHP:




$tags='visita,fotopex,recorriendo.la.mixteca';


$array_sustitucion=array&#40;',','.','/',':'&#41;; // por si acaso tengas alguno de estos caracteres los reemplazamos por comas


$tags=str_replace&#40;$array_sustitucion, ",", $var1&#41;;


$tags=explode&#40;",",$tags&#41;;


// ahora las mostramos


while &#40;list&#40;$clave, $valor&#41; = each&#40;$tags&#41;&#41;&#123;


&#160; echo $clave.'('.$valor.')&#60;br /&#62;';


&#125; 






]]></description>
			<content:encoded><![CDATA[<p>Cuando mostramos <a href="http://ayuda.fotopex.com/programacion/php/como-hacer-una-nube-de-etiquetas-con-php/">cómo hacer una nube de etiquetas </a>, también vimos un ejemplo de como utilizar la instrucción <strong>explode</strong>.</p>
<p>&nbsp;</p>
<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<div class="igBar"><span id="lphp-26"><a href="#" onclick="javascript:showPlainTxt('php-26'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-26">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$tags</span>=<span style="color:#FF0000;">'visita,fotopex,recorriendo.la.mixteca'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$array_sustitucion</span>=<a href="http://www.php.net/array" target="_blank"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">','</span>,<span style="color:#FF0000;">'.'</span>,<span style="color:#FF0000;">'/'</span>,<span style="color:#FF0000;">':'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// por si acaso tengas alguno de estos caracteres los reemplazamos por comas</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$tags</span>=<a href="http://www.php.net/str_replace" target="_blank"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$array_sustitucion</span>, <span style="color:#FF0000;">","</span>, <span style="color:#0000FF;">$var1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$tags</span>=<a href="http://www.php.net/explode" target="_blank"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">","</span>,<span style="color:#0000FF;">$tags</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// ahora las mostramos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/list" target="_blank"><span style="color:#000066;">list</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$clave</span>, <span style="color:#0000FF;">$valor</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <a href="http://www.php.net/each" target="_blank"><span style="color:#000066;">each</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tags</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$clave</span>.<span style="color:#FF0000;">'('</span>.<span style="color:#0000FF;">$valor</span>.<span style="color:#FF0000;">')&lt;br /&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/convertir-texto-en-un-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obtener todos los links de una página con php</title>
		<link>http://ayuda.fotopex.com/programacion/php/obtener-todos-los-links-de-una-pagina-con-php/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/obtener-todos-los-links-de-una-pagina-con-php/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 02:41:30 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[atributo]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=691</guid>
		<description><![CDATA[Un código básico de como obtienen algunos spiders la dirección url del código html
Texto Plano
PHP:




$html = file_get_contents&#40;'http://www.fotopex.com'&#41;;


$dom = new DOMDocument&#40;&#41;; // creamos un nuevo documento


@$dom-&#62;loadHTML&#40;$html&#41;; // cargamos el código html


// obtenemos todo de la pagina


$xpath = new DOMXPath&#40;$dom&#41;;


$hrefs = $xpath-&#62;evaluate&#40;"/html/body//a"&#41;;


for &#40;$i = 0; $i &#60;$hrefs-&#62;length; $i++&#41; &#123;


&#160; &#160; &#160; &#160;$href = $hrefs-&#62;item&#40;$i&#41;;


&#160; &#160; &#160; &#160;$url [...]]]></description>
			<content:encoded><![CDATA[<p>Un código básico de como obtienen algunos spiders la dirección url del código html</p>
<div class="igBar"><span id="lphp-28"><a href="#" onclick="javascript:showPlainTxt('php-28'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-28">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$html</span> = <a href="http://www.php.net/file_get_contents" target="_blank"><span style="color:#000066;">file_get_contents</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'http://www.fotopex.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dom</span> = <span style="color:#000000; font-weight:bold;">new</span> DOMDocument<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// creamos un nuevo documento</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@<span style="color:#0000FF;">$dom</span>-&gt;<span style="color:#006600;">loadHTML</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$html</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// cargamos el código html</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// obtenemos todo de la pagina</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$xpath</span> = <span style="color:#000000; font-weight:bold;">new</span> DOMXPath<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dom</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$hrefs</span> = <span style="color:#0000FF;">$xpath</span>-&gt;<span style="color:#006600;">evaluate</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"/html/body//a"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;<span style="color:#0000FF;">$hrefs</span>-&gt;<span style="color:#006600;">length</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$href</span> = <span style="color:#0000FF;">$hrefs</span>-&gt;<span style="color:#006600;">item</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$url</span> = <span style="color:#0000FF;">$href</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'href'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// finalmente obtenemos la url</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/echo" target="_blank"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$url</span>.<span style="color:#FF0000;">'&lt;br /&gt;'</span>; <span style="color:#FF9933; font-style:italic;">// la desplegamos en pantalla</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<span id="more-691"></span><br />
Espero que te ayude para cosas buenas.</p>
<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/obtener-todos-los-links-de-una-pagina-con-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corregir el error &#8220;Allowed memory size of 33554432 bytes exhausted&#8221;</title>
		<link>http://ayuda.fotopex.com/programacion/php/corregir-el-error-allowed-memory-size-of-33554432-bytes-exhausted/</link>
		<comments>http://ayuda.fotopex.com/programacion/php/corregir-el-error-allowed-memory-size-of-33554432-bytes-exhausted/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 13:07:24 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Memoria]]></category>
		<category><![CDATA[Solución]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=650</guid>
		<description><![CDATA[Con la actualización a Wordpress 2.8, muchos a muchos les ha saltado alguno de estos errores y otros más ni siquiera pudieron entrar al panel de administración pues mostraba una pagina en blanco:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/FotoPex/public_html/wp-includes/class-simplepie.php on line 13235
Fatal error: Allowed memory size [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ayuda.fotopex.com/wp-content/uploads/2009/06/error-simplepie.jpg" alt="error-simplepie" title="error-simplepie" width="297" height="173" class="alignleft size-full wp-image-658" />Con la actualización a Wordpress 2.8, muchos a muchos les ha saltado alguno de estos errores y otros más ni siquiera pudieron entrar al panel de administración pues mostraba una pagina en blanco:</p>
<div style="clear:both;"></div>
<blockquote><p>Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/FotoPex/public_html/wp-includes/class-simplepie.php on line 13235</p></blockquote>
<blockquote><p>Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/FotoPex/public_html/wp-includes/class-simplepie.php on line 2618</p></blockquote>
<p>Para solucionar el problema solo tienes que agregar la siguiente linea en tu archivo wp-config.php:<span id="more-650"></span></p>
<p><strong>define('WP_MEMORY_LIMIT', '64M');</strong></p>
<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<p>La explicación es simple, en ambos casos el error indica que 32MB (33554432/1024=32768)no son suficientes, entonces lo extendí a 64 y el error se fue.</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/php/corregir-el-error-allowed-memory-size-of-33554432-bytes-exhausted/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Reemplazando Cadenas en Tablas de MySQL</title>
		<link>http://ayuda.fotopex.com/programacion/bases-de-datos/reemplazando-cadenas-en-tablas-de-mysql/</link>
		<comments>http://ayuda.fotopex.com/programacion/bases-de-datos/reemplazando-cadenas-en-tablas-de-mysql/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 14:07:31 +0000</pubDate>
		<dc:creator>Mr. FotoPex</dc:creator>
				<category><![CDATA[Bases de Datos]]></category>
		<category><![CDATA[actualizar]]></category>
		<category><![CDATA[base]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://ayuda.fotopex.com/?p=646</guid>
		<description><![CDATA[Si necesitas reemplazar un mismo texto en varios registros en MySQL puedes hacerlo de la siguiente manera.
Texto Plano
MySQL:




UPDATE la_tabla


&#160;SET el_campo =


&#160;REPLACE &#40;el_campo,’texto_antiguo’,texto_nuevo’&#41; 






Esta forma es la ideal para realizar cambios de forma masiva.

 




]]></description>
			<content:encoded><![CDATA[<p>Si necesitas reemplazar un mismo texto en varios registros en MySQL puedes hacerlo de la siguiente manera.</p>
<div class="igBar"><span id="lmysql-30"><a href="#" onclick="javascript:showPlainTxt('mysql-30'); return false;">Texto Plano</a></span></div>
<div class="syntax_hilite"><span class="langName">MySQL:</span>
<div id="mysql-30">
<div class="mysql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">UPDATE</span> la_tabla</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #993333; font-weight: bold;">SET</span> el_campo =</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #66cc66;">&#40;</span>el_campo,’texto_antiguo’,texto_nuevo’<span style="color: #66cc66;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Esta forma es la ideal para realizar cambios de forma masiva.<span id="more-646"></span></p>
<p>
 <script type="text/javascript"><!--
google_ad_client = "pub-6087605660472467";
/* ayuda-foto-adsense-cuadro300x250, creado 4/12/08 4 k 1 */ 
google_ad_slot = "1220677556";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ayuda.fotopex.com/programacion/bases-de-datos/reemplazando-cadenas-en-tablas-de-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
