<?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>Mas que Wordpress &#187; MySQL</title>
	<atom:link href="http://www.masquewordpress.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masquewordpress.com</link>
	<description>Tutoriales y recursos web sobre JQuery , PHP, Wordpress , twitter. Aprende diseño web y programación</description>
	<lastBuildDate>Sat, 19 May 2012 17:05:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>63 Tutoriales de Diseño Web, jQuery, WordPress y un montón más</title>
		<link>http://www.masquewordpress.com/63-tutoriales-de-diseno-web-jquery-wordpress-y-un-monton-mas/</link>
		<comments>http://www.masquewordpress.com/63-tutoriales-de-diseno-web-jquery-wordpress-y-un-monton-mas/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 14:30:48 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Noticias]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=819</guid>
		<description><![CDATA[63 Tutoriales de Diseño Web, jQuery, WordPress y un montón más es la cantidad reunida hasta día de hoy en mi blog. Eso sin contar los &#8220;pequeños trucos o tips&#8221; que son demasiado cortos para contarlos como tutoriales. Alguien quiere colaborar con un tutorial propio? Saludos!!]]></description>
			<content:encoded><![CDATA[<p><a href="http://masquewordpress.com/tutoriales/">63 Tutoriales de Diseño Web, jQuery, WordPress y un montón más</a> es la cantidad reunida hasta día de hoy en mi blog. Eso sin contar los &#8220;pequeños trucos o tips&#8221; que son demasiado cortos para contarlos como tutoriales.</p>
<p>Alguien quiere colaborar con un tutorial propio?</p>
<p>Saludos!!</p>
<p><div style="float:left; text-align:left;><img alt='' src='http://1.gravatar.com/avatar/516ffa1373c8295d2e5ff5267fc53399?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><h3><a href='http://www.masquewordpress.com/author/Damian/' title='Damian'>Damian</a></h3><p>Programador en tiempos libres , amante de la tecnología, blogger amateur y emprendedor en sueños.</p><p><a href='http://www.masquewordpress.com/author/Damian/' title='M&aacute;s post de Damian'>M&aacute;s Posts de Damian</a>  - <a href='http://www.timersys.com' title='Damian'>Web</a> </p><p class="wpa-nomargin">Sigueme:<br /><a class='wpa-social-icons' href='http://www.twitter.com/chifliiiii'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/twitter.png' alt='Twitter'/></a><a class='wpa-social-icons' href='http://www.facebook.com/pages/Timersys/146687622031640'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/facebook.png' alt='Facebook'/></a><a class='wpa-social-icons' href='http://ar.linkedin.com/pub/damian-logghe/26/173/321'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/linkedin.png' alt='LinkedIn'/></a></p></p>]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/63-tutoriales-de-diseno-web-jquery-wordpress-y-un-monton-mas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Que necesitan ?</title>
		<link>http://www.masquewordpress.com/que-necesitan/</link>
		<comments>http://www.masquewordpress.com/que-necesitan/#comments</comments>
		<pubDate>Fri, 28 May 2010 22:03:26 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Recursos]]></category>
		<category><![CDATA[ejemplos jquery]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=416</guid>
		<description><![CDATA[Hola a todos!! En este post no voy a explicar ningun plugin , ni hablar de JQuery , ni juegos , ni nada. Tan solo les quiero preguntar a ustedes, mis lectores ¿Que necesitan? Si hace tiempo que buscan algun tutorial o tienen visto alguno que no deja de todo claro las cosas. Encontraron un [...]]]></description>
			<content:encoded><![CDATA[<p>Hola a todos!! En este post no voy a explicar ningun <a href="http://masquewordpress.com/tag/jquery-plugin/">plugin</a> , ni hablar de <a href="http://masquewordpress.com/tag/jquery/">JQuery</a> , ni juegos , ni nada. Tan solo les quiero preguntar a ustedes, mis lectores <strong>¿Que necesitan?</strong></p>
<p>Si hace tiempo que buscan algun<a href="http://masquewordpress.com/category/tutoriales/"> tutorial</a> o tienen visto alguno que no deja de todo claro las cosas. Encontraron un <a href="http://masquewordpress.com/category/plugins/">plugin raro de JQuery</a> y no le sacan la vuelta a como usarlo. No entienden bien algun tema de <a href="http://masquewordpress.com/tag/php/">PHP</a> o <a href="http://masquewordpress.com/tag/mysql/">Mysql</a>. Hoy están de suerte, dejen en los comentarios que necesitan y si puedo los iré ayudando.</p>
<p>Eso es todo , un saludo!!!</p>
<p><div style="float:left; text-align:left;><img alt='' src='http://1.gravatar.com/avatar/516ffa1373c8295d2e5ff5267fc53399?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><h3><a href='http://www.masquewordpress.com/author/Damian/' title='Damian'>Damian</a></h3><p>Programador en tiempos libres , amante de la tecnología, blogger amateur y emprendedor en sueños.</p><p><a href='http://www.masquewordpress.com/author/Damian/' title='M&aacute;s post de Damian'>M&aacute;s Posts de Damian</a>  - <a href='http://www.timersys.com' title='Damian'>Web</a> </p><p class="wpa-nomargin">Sigueme:<br /><a class='wpa-social-icons' href='http://www.twitter.com/chifliiiii'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/twitter.png' alt='Twitter'/></a><a class='wpa-social-icons' href='http://www.facebook.com/pages/Timersys/146687622031640'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/facebook.png' alt='Facebook'/></a><a class='wpa-social-icons' href='http://ar.linkedin.com/pub/damian-logghe/26/173/321'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/linkedin.png' alt='LinkedIn'/></a></p></p>]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/que-necesitan/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Paginación con PHP y MySQL + 3 estilos</title>
		<link>http://www.masquewordpress.com/paginacion-con-php-y-mysql-3-estilos/</link>
		<comments>http://www.masquewordpress.com/paginacion-con-php-y-mysql-3-estilos/#comments</comments>
		<pubDate>Mon, 25 May 2009 18:08:23 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[paginacion]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=23</guid>
		<description><![CDATA[En este tutorial les voy a enseñar el método que utilizo para hacer paginación en mis diseños.Pero para empezar ¿A que se le llama paginación? Esto es simplemente el índice que aparece abajo del todo que algunas veces contiene números y otras no, y nos sirve para cambiar de página. Es muy útil cuando tenemos [...]]]></description>
			<content:encoded><![CDATA[<p>En este tutorial les voy a enseñar el método que utilizo para hacer paginación en mis diseños.Pero para empezar ¿A que se le llama paginación? Esto es simplemente el índice que aparece abajo del todo que algunas veces contiene números y otras no, y nos sirve para cambiar de página. Es muy útil cuando tenemos muchos datos para mostrar y ya resulta feo que aparezca todo en la misma página.</p>
<h3>Típica estructura:</h3>
<p style="text-align: center;"><img class="size-full wp-image-25 aligncenter" style="border: 0pt none; background-color: #fff;" title="estructura-paginacion" src="http://masquewordpress.com/wp-content/uploads/2009/05/estructura-paginacion.png" alt="estructura paginación" width="335" height="162" /></p>
<p>La estructura más comun suele contar con 2 botones (Previous y next) más otros tantos con los números de las páginas que tengamos(variable segun la cantidad de datos). El número resaltado indica en que página nos encontramos actualmente , y si no hay más páginas hacia abajo o hacia arriba se deshabilitaran los botones de Previous y Next respectivamente. Por último tenemos el selector de números que nos permitira saltar directamente a cualquier página sin necesidad de pasar una a una.</p>
<p>Para diseñar esta estructura usaremos una lista HTML (&lt;ul&gt;) que a su vez contendra tantos elementos de lista (&lt;li&gt;) como sea necesario. A cada lista le vamos a asignar un ID que definirá su estilo. A continuación paso a explicar más detalladamente.</p>
<h3>Paginación al estilo de Flickr:</h3>
<p>En este caso vamos a diseñar la paginación al estilo de Flickr y se verá del siguiente modo:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-26" title="flicrk" src="http://masquewordpress.com/wp-content/uploads/2009/05/flicrk.png" alt="flicrk" width="266" height="46" /></p>
<p>El código HTML que vamos a usar es muy simple y nos servira como esqueleto para cualquier estilo , ya que solo necesitaremos cambiar el ID de la lista que en el siguiente caso será <strong><em> &#8220;pagination-flickr&#8221;.</em></strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pagination-flickr&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;previous-off&quot;</span>&gt;</span>«Previous<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;active&quot;</span>&gt;</span>1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=2&quot;</span>&gt;</span>2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=3&quot;</span>&gt;</span>3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=4&quot;</span>&gt;</span>4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=5&quot;</span>&gt;</span>5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=6&quot;</span>&gt;</span>6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=7&quot;</span>&gt;</span>7<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;next&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=8&quot;</span>&gt;</span>Next »<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<p>Ahora solo nos queda agregar el <strong>código CSS</strong> para darle estilo a nuestra lista:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* -------------------------------------------- */</span>
<span style="color: #808080; font-style: italic;">/* ------------- Pagination: Flickr -----------	*/</span>
<span style="color: #808080; font-style: italic;">/* -------------------------------------------- */</span>
ul    <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> li          <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* savers */</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> a           <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#DDDDDD</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> .previous-off<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-flickr</span> <span style="color: #6666ff;">.next-off</span>   <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> <span style="color: #6666ff;">.next</span> a<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-flickr</span> <span style="color: #6666ff;">.previous</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> <span style="color: #6666ff;">.active</span>     <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff0084</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-flickr</span> a<span style="color: #3333ff;">:visited   </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0063e3</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-flickr</span> a<span style="color: #3333ff;">:hover     </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Paginación al estilo de DIGG:</h3>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-27" title="digg" src="http://masquewordpress.com/wp-content/uploads/2009/05/digg.png" alt="digg" width="277" height="33" /></p>
<p>La estructura como pueden ver es la misma. Solo cambiamos el atributo ID de la lista.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pagination-digg&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;previous-off&quot;</span>&gt;</span>«Previous<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;active&quot;</span>&gt;</span>1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=2&quot;</span>&gt;</span>2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=3&quot;</span>&gt;</span>3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=4&quot;</span>&gt;</span>4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=5&quot;</span>&gt;</span>5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=6&quot;</span>&gt;</span>6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=7&quot;</span>&gt;</span>7<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;next&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;?page=8&quot;</span>&gt;</span>Next »<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<p>Y nuevamente añadiremos el estilo correspondiente. Como vereis los elementos son los mismos, solo cambiamos algunos atributos:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* -------------------------------------------- */</span>
<span style="color: #808080; font-style: italic;">/* ----------- Pagination: Digg Style --------- */</span>
<span style="color: #808080; font-style: italic;">/* -------------------------------------------- */</span>
ul    <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> li          <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* savers */</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> a           <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#9aafe5</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> .previous-off<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-digg</span> <span style="color: #6666ff;">.next-off</span>   <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#DEDEDE</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#888888</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> <span style="color: #6666ff;">.next</span> a<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-digg</span> <span style="color: #6666ff;">.previous</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> <span style="color: #6666ff;">.active</span>     <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#2e6ab1</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* savers */</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-digg</span> a<span style="color: #3333ff;">:visited   </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0e509e</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-digg</span> a<span style="color: #3333ff;">:hover     </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#0e509e</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Estilo de paginación limpio:</h3>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-28" title="clean" src="http://masquewordpress.com/wp-content/uploads/2009/05/clean.png" alt="clean" width="270" height="34" /></p>
<p>Para crear un estilo un poco más limpio y menos cargado podemos usar el siguiente codigo CSS. Recordar que tienen que cambiar el <strong>ID</strong> del elemento <strong>&lt;ul&gt;</strong> por <strong> &#8220;pagination-clean&#8221; </strong>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* -------------------------------------------- */</span>
<span style="color: #808080; font-style: italic;">/* ------------- Pagination: Clean ------------ */</span>
<span style="color: #808080; font-style: italic;">/* -------------------------------------------- */</span>
<span style="color: #cc00cc;">#pagination-clean</span> li          <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* savers */</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* savers #pagination-clean li,*/</span>
<span style="color: #cc00cc;">#pagination-clean</span> a           <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#DEDEDE</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-clean</span> .previous-off<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-clean</span> <span style="color: #6666ff;">.next-off</span>   <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#888888</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-clean</span> <span style="color: #6666ff;">.next</span> a<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-clean</span> previous a  <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-clean</span> <span style="color: #6666ff;">.active</span>     <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* savers */</span> <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span><span style="color: #993333;">solid</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#DEDEDE</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-clean</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#pagination-clean</span> a<span style="color: #3333ff;">:visited   </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0e509e</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#pagination-clean</span> a<span style="color: #3333ff;">:hover     </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Con esto ya tenemos unas listas y su correspondientes estilos para que nuestra paginación quede de una forma profesional. El siguiente paso es añadir el codigo PHP necesario para crear el índice de acuerdo a la cantidad de datos que tengamos y poder así modificar la consulta SQL para que nos muestre ciertos resultados. Para las conexiones a la base de datos voy a seguir los pasos descritos en <a href="http://masquewordpress.com/php/dbphp-como-definir-los-parametros-de-conexion-de-tu-base-de-datos/" target="_blank">este artículo</a>.</p>
<p>Para empezar necesitamos hacer 2 consultas SQL en lugar de 1. La primera va a ser para recuperar <strong>TODOS </strong> los datos y asi poder calcular cuantas páginas vamos a necesitar. La segunda consulta va a mostrar un rango de resultados según en que página estemos.</p>
<p>Por ejemplo digamos que queremos mostrar una tabla con datos de películas donde nos muestre el nombre de la película, el año de creación , etc. La tabla SQL esta compuesto por los siguientes campos: idPelicula(int(5)), nombre(VARCHAR(150)), director(VARCHAR(100)), anio(DATE).</p>
<p>A continuación como seria el código:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//INCLUYO LA HOJA DE ESTILOS</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;link href=&quot;css/paginacion.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config/db.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$conn</span><span style="color: #339933;">=</span>get_db_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//AL PRINCIPIO COMPRUEBO SI HICIERON CLICK EN ALGUNA PÁGINA </span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$page</span><span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//SI NO DIGO Q ES LA PRIMERA PÁGINA</span>
    <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//ACA SE SELECCIONAN TODOS LOS DATOS DE LA TABLA</span>
<span style="color: #000088;">$consulta</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SELECT * FROM peliculas&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$datos</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$consulta</span><span style="color: #339933;">,</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//MIRO CUANTOS DATOS FUERON DEVUELTOS</span>
<span style="color: #000088;">$num_rows</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$datos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//ACA SE DECIDE CUANTOS RESULTADOS MOSTRAR POR PÁGINA , EN EL EJEMPLO PONGO 15</span>
<span style="color: #000088;">$rows_per_page</span><span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//CALCULO LA ULTIMA PÁGINA</span>
<span style="color: #000088;">$lastpage</span><span style="color: #339933;">=</span> <span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$num_rows</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$rows_per_page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//COMPRUEBO QUE EL VALOR DE LA PÁGINA SEA CORRECTO Y SI ES LA ULTIMA PÁGINA</span>
<span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$page</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$lastpage</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$page</span><span style="color: #339933;">=</span> <span style="color: #000088;">$lastpage</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$page</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//CREO LA SENTENCIA LIMIT PARA AÑADIR A LA CONSULTA QUE DEFINITIVA</span>
<span style="color: #000088;">$limit</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'LIMIT '</span><span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$rows_per_page</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">','</span> <span style="color: #339933;">.</span><span style="color: #000088;">$rows_per_page</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//REALIZO LA CONSULTA QUE VA A MOSTRAR LOS DATOS (ES LA ANTERIO + EL $limit)</span>
<span style="color: #000088;">$consulta</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot; <span style="color: #006699; font-weight: bold;">$limit</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$peliculas</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$consulta</span><span style="color: #339933;">,</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$peliculas</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//SI FALLA LA CONSULTA MUESTRO ERROR</span>
 <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Invalid query: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">//SI ES CORRECTA MUESTRO LOS DATOS </span>
      <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;table&gt;&lt;thead&gt;
        &lt;tr&gt;&lt;th&gt;Título&lt;/th&gt;&lt;th&gt;Director&lt;/th&gt;&lt;th&gt; Año de producción&lt;/th&gt;&lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$peliculas</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;tr&gt;&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nombre'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;&lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'director'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;&lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'anio'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;&lt;/tr&gt;
       <span style="color: #000000; font-weight: bold;">&lt;?</span>  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;/tbody&gt;
      &lt;/table&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #666666; font-style: italic;">//UNA VEZ Q MUESTRO LOS DATOS TENGO Q MOSTRAR EL BLOQUE DE PAGINACIÓN SIEMPRE Y CUANDO HAYA MÁS DE UNA PÁGINA</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numrows</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$nextpage</span><span style="color: #339933;">=</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$prevpage</span><span style="color: #339933;">=</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;ul id=&quot;pagination-digg&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #666666; font-style: italic;">//SI ES LA PRIMERA PÁGINA DESHABILITO EL BOTON DE PREVIOUS, MUESTRO EL 1 COMO ACTIVO Y MUESTRO EL RESTO DE PÁGINAS</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 	<span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;li class=&quot;previous-off&quot;&gt;&amp;laquo; Previous&lt;/li&gt;
      &lt;li class=&quot;active&quot;&gt;1&lt;/li&gt; <span style="color: #000000; font-weight: bold;">&lt;?</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span> <span style="color: #000088;">$page</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$lastpage</span> <span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;li&gt;&lt;a href=&quot;busquedas.php?page=<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/li&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #009900;">&#125;</span>
       <span style="color: #666666; font-style: italic;">//Y SI LA ULTIMA PÁGINA ES MAYOR QUE LA ACTUAL MUESTRO EL BOTON NEXT O LO DESHABILITO</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lastpage</span> <span style="color: #339933;">&gt;</span><span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>		
      &lt;li class=&quot;next&quot;&gt;&lt;a href=&quot;busquedas.php?page=<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$nextpage</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; &gt;Next &amp;raquo;&lt;/a&gt;&lt;/li&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
	  &lt;li class=&quot;next-off&quot;&gt;Next &amp;raquo;&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span>	<span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//EN CAMBIO SI NO ESTAMOS EN LA PÁGINA UNO HABILITO EL BOTON DE PREVIUS Y MUESTRO LAS DEMÁS</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	 &lt;li class=&quot;previous&quot;&gt;&lt;a href=&quot;busquedas.php?page=<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$prevpage</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;  &gt;&amp;laquo; Previous&lt;/a&gt;&lt;/li&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
      <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$lastpage</span> <span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                       <span style="color: #666666; font-style: italic;">//COMPRUEBO SI ES LA PÁGINA ACTIVA O NO</span>
	  		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>	&lt;li class=&quot;active&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
			<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>	&lt;li&gt;&lt;a href=&quot;busquedas.php?page=<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; &gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/li&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
			<span style="color: #009900;">&#125;</span>
	  <span style="color: #009900;">&#125;</span>
         <span style="color: #666666; font-style: italic;">//Y SI NO ES LA ÚLTIMA PÁGINA ACTIVO EL BOTON NEXT		</span>
	  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lastpage</span> <span style="color: #339933;">&gt;</span><span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>	<span style="color: #000000; font-weight: bold;">?&gt;</span>	
      &lt;li class=&quot;next&quot;&gt;&lt;a href=&quot;busquedas.php?page=<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$nextpage</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Next &amp;raquo;&lt;/a&gt;&lt;/li&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
	  <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;li class=&quot;next-off&quot;&gt;Next &amp;raquo;&lt;/li&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
	  <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span>	  
<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/ul&gt;&lt;/div&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Seguramente esta última parte del codigo se pueda mejorar ya que la escribí un poco &#8220;rapido&#8221;, así que estoy abierto a sugerencias. De todas formas a mi me funciona todo correctamente. Espero que les haya servido de ayuda, ya que en su día me costo mucho encontrar un buen tutorial sobre la paginación y ninguno de los que encontre venia completo. Un saludo!!!</p>
<h4><a href="http://masquewordpress.com/ejemplos/paginacion.rar">Descargar ejemplo</a></h4>
<div class="avia-box alert    "><span class="avia-innerbox" ><a href="http://www.masquewordpress.com/paginacion-php-con-clase/">Nueva version usando una clase PHP</a></span></div>
<p><div style="float:left; text-align:left;><img alt='' src='http://1.gravatar.com/avatar/516ffa1373c8295d2e5ff5267fc53399?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><h3><a href='http://www.masquewordpress.com/author/Damian/' title='Damian'>Damian</a></h3><p>Programador en tiempos libres , amante de la tecnología, blogger amateur y emprendedor en sueños.</p><p><a href='http://www.masquewordpress.com/author/Damian/' title='M&aacute;s post de Damian'>M&aacute;s Posts de Damian</a>  - <a href='http://www.timersys.com' title='Damian'>Web</a> </p><p class="wpa-nomargin">Sigueme:<br /><a class='wpa-social-icons' href='http://www.twitter.com/chifliiiii'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/twitter.png' alt='Twitter'/></a><a class='wpa-social-icons' href='http://www.facebook.com/pages/Timersys/146687622031640'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/facebook.png' alt='Facebook'/></a><a class='wpa-social-icons' href='http://ar.linkedin.com/pub/damian-logghe/26/173/321'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/linkedin.png' alt='LinkedIn'/></a></p></p>]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/paginacion-con-php-y-mysql-3-estilos/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>DB.php : Como definir los parametros de conexión de tu base de datos</title>
		<link>http://www.masquewordpress.com/dbphp-como-definir-los-parametros-de-conexion-de-tu-base-de-datos/</link>
		<comments>http://www.masquewordpress.com/dbphp-como-definir-los-parametros-de-conexion-de-tu-base-de-datos/#comments</comments>
		<pubDate>Sun, 24 May 2009 18:49:59 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[base de datos]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=58</guid>
		<description><![CDATA[En mis diseños siempre defino los valores de conexión a la base de datos en un archivo php llamado db.php  (database name, username, password, database host), de forma que cada vez que necesito conectarme tan solo tengo que hacer un include del mismo. Una vez que tengamos creado nuestra base de datos a traves de [...]]]></description>
			<content:encoded><![CDATA[<p>En mis diseños siempre defino los valores de conexión a la base de datos en un archivo php llamado <strong>db.php</strong>  (database name, username, password, database host), de forma que cada vez que necesito conectarme tan solo tengo que hacer un include del mismo.</p>
<p>Una vez que tengamos creado nuestra base de datos a traves de phpMyAdmin o desde nuestro gestor en el hosting, tan solo tenemos que crear este archivo, que es muy sencillo y solo ocupa unas lineas.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #666666; font-style: italic;">//datos de conexion que hay que editar con los que corresponda</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_IP'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'unnombredeusuario'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_PASS'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'unpassword'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'nombredelabasededatos'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Funcion que vamos a usar para realizar la conexion (Acá no se edita nada)</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000000; font-weight: bold;">function</span> get_db_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_IP'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_PASS'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;No pudo conectarse a la BD: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Con eso ya tendriamos los datos de conexión listos, aunque yo siempre agrego una pequeña funcion para proteger los datos de inyección SQL (o como dicen en ingles SQL INJECTIONS).Por lo que me aseguro que cada vez que carga una conexion , cargo también la funcion que me va a ayudar a protegerme.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//PARA PROTEGER SQL INJECT</span>
<span style="color: #000000; font-weight: bold;">function</span> cleanQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">get_magic_quotes_gpc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>   <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">phpversion</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;=</span> <span style="color: #0000ff;">'4.3.0'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Por lo tanto nuestro archivo db.php queria de la siguiente manera:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_IP'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'unnombredeusuario'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_PASS'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'unpassword'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'nombredelabasededatos'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Database queries</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #000000; font-weight: bold;">function</span> get_db_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_IP'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_PASS'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;No pudo conectarse a la BD: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//PARA PROTEGER SQL INJECT</span>
<span style="color: #000000; font-weight: bold;">function</span> cleanQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">get_magic_quotes_gpc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #666666; font-style: italic;">// prevents duplicate backslashes</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">phpversion</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;=</span> <span style="color: #0000ff;">'4.3.0'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Una vez armado el db.php , solo nos queda incluirlo en nuestras páginas. y lo haremos de la siguiente manera:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Una vez incluido nuestro archivo podemos realizar una nueva conexión de la siguiente forma:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Creamos la variable $conn y le asignamos la conexión a la base de datos</span>
<span style="color: #000088;">$conn</span><span style="color: #339933;">=</span>get_db_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>La función <strong>cleanQuery</strong> la vamos a usar para &#8220;limpiar&#8221; las variables. Si juntamos todo los visto anteriormente y suponiendo que tenemos un archivo llamado busquedas.php al cual le pasamos una variable $_GET['pelicula'] podriamos dejar el código de la siguiente manera:</p>
<p>EJ:<strong>busquedas.php?pelicula=killBill</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$conn</span><span style="color: #339933;">=</span>get_db_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$nombrePelicula</span><span style="color: #339933;">=</span> cleanQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pelicula'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$consulta</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;SELECT * FROM peliculas WHERE nombre='<span style="color: #006699; font-weight: bold;">$nombrePelicula</span>'&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$peliculas</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$consulta</span><span style="color: #339933;">,</span> <span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$peliculas</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Invalid query: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">//la consulta se ejecuto correctamente y mostramos los datos</span>
   <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;table&gt;&lt;thead&gt;
        &lt;tr&gt;&lt;th&gt;Título&lt;/th&gt;&lt;th&gt;Director&lt;/th&gt;&lt;th&gt; Año de producción&lt;/th&gt;&lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> mysql_fecth_assoc<span style="color: #009900;">&#40;</span><span style="color: #000088;">$peliculas</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;tr&gt;&lt;td&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nombre'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;&lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'director'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;&lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'año'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;&lt;/tr&gt;
       <span style="color: #000000; font-weight: bold;">&lt;?</span>  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;/tbody&gt;
      &lt;/table&gt;</pre></td></tr></table></div>

<p>Esta sería la forma sencilla de configurar las conexiones a una base de datos. Por favor comenten cualquier duda que vaya surgiendo. Un Saludo</p>
<h4><a href="http://masquewordpress.com/ejemplos/db.rar">Descargar db.php</a></h4>
<p><div style="float:left; text-align:left;><img alt='' src='http://1.gravatar.com/avatar/516ffa1373c8295d2e5ff5267fc53399?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><h3><a href='http://www.masquewordpress.com/author/Damian/' title='Damian'>Damian</a></h3><p>Programador en tiempos libres , amante de la tecnología, blogger amateur y emprendedor en sueños.</p><p><a href='http://www.masquewordpress.com/author/Damian/' title='M&aacute;s post de Damian'>M&aacute;s Posts de Damian</a>  - <a href='http://www.timersys.com' title='Damian'>Web</a> </p><p class="wpa-nomargin">Sigueme:<br /><a class='wpa-social-icons' href='http://www.twitter.com/chifliiiii'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/twitter.png' alt='Twitter'/></a><a class='wpa-social-icons' href='http://www.facebook.com/pages/Timersys/146687622031640'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/facebook.png' alt='Facebook'/></a><a class='wpa-social-icons' href='http://ar.linkedin.com/pub/damian-logghe/26/173/321'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/linkedin.png' alt='LinkedIn'/></a></p></p>]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/dbphp-como-definir-los-parametros-de-conexion-de-tu-base-de-datos/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Como instalar apache + php + mysql + phpMyAdmin  en windows</title>
		<link>http://www.masquewordpress.com/como-instalar-apache-php-mysql-phpmyadmin-en-windows/</link>
		<comments>http://www.masquewordpress.com/como-instalar-apache-php-mysql-phpmyadmin-en-windows/#comments</comments>
		<pubDate>Thu, 21 May 2009 14:36:31 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[appserv]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[servidor web]]></category>

		<guid isPermaLink="false">http://masquewordpress.com/?p=38</guid>
		<description><![CDATA[AppServ es un software que nos permite instalar sobre Windows: Apache, PHP, MySQL y phpMyAdmin (interfaz gráfica para adminsitrar MySQL) de forma conjunta. Es una aplicación muy útil porque en unos pocos pasos podemos tener un servidor corriendo y listo para hacer pruebas. Así que no nos va a hacer falta contratar un servidor , [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a title="Appserv" href="http://www.appservnetwork.com/" target="_blank">AppServ</a> </strong>es un software que nos permite instalar sobre Windows: Apache, PHP, MySQL y phpMyAdmin (interfaz gráfica para adminsitrar MySQL) de forma conjunta. Es una aplicación muy útil porque en unos pocos pasos podemos tener un servidor corriendo y listo para hacer pruebas. Así que no nos va a hacer falta contratar un servidor , dominio, etc..</p>
<div id="attachment_41" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-41" title="appserv" src="http://masquewordpress.com/wp-content/uploads/2009/05/appserv-300x222.jpg" alt="Home Page Appserv" width="300" height="222" /><p class="wp-caption-text">Home Page Appserv</p></div>
<p>Esta es la forma más facil de diseñar sin tener que estar subiendo archivos a tu servidor, ya que una vez que tenemos todo listo lo subimos y punto.</p>
<p>Para instalar AppServ tenemos que seguir los siguientes pasos:</p>
<ul class="bbc_list">
<li>En primer lugar descargamos el último paquete desde <a class="bbc_link new_win" href="http://sourceforge.net/project/showfiles.php?group_id=37459" target="_blank">SourceForge</a></li>
<li>Una vez descargado el ejecutable procedemos a ejecutar la instalación, vamos a ver el  mensaje de bienvenida y hacemos Click en Next</li>
<li><strong>Directorio de Instalación</strong>: en esta pantalla nos solicita el directorio en el que queremos instalar la aplicación, por defecto nos marca “c:/appserv”, lo cambiamos si queremos y pulsamos Next.</li>
<li><strong>Tipo de Instalación</strong>: Elegimos Typical.</li>
<li><strong>Server Information</strong>: La casilla Server Name la dejamos como viene por defecto con “Localhost” y en la casilla Administrator E-mail Address o lo dejamos como viene por defecto y luego lo cambiamos, o le introducimos una cuenta de correo que sera la del administrador. El campo “HTTP Port” lo dejamos como viene por defecto (80), salvo que queramos que el servidor atienda les peticiones en otro puerto. Pulsamos en Next</li>
<li><strong>MySql Information</strong>: Este es uno de los apartados más importantes ya que empezamos a instalar MySQL. En la casilla Username introduciremos el nombre del administrador de la base de datos y en la casilla Password le introducimos la contraseña, aunque si queremos hacerlo más fácil ponemos como usuario: root y el apartado contraseña lo dejamos vacio ya que posteriormente podemos cambiarlo con phpMyAdmin. El apartado Charset lo dejamos tal como viene por defecto. Pulsamos en Next</li>
<li><strong>Progreso de la instalación</strong>: Empieza realmente la instalación mostrandonos una barra de progreso hasta que aparece una pantalla que nos avisa de que ha finalizado la misma, debiendo dejar marcadas las opciones que vienen por defecto. Finalmente pulsamos en Close.</li>
<li>Comprobación de la instalación: Si hemos hecho bien los deberes al poner en nuestro navegador: <a class="bbc_link new_win" href="http://localhost/" target="_blank">http://localhost</a> nos debe aparecer la pantalla de AppServ Open Project con algunos link como el phpInfo o a phpmyadmin</li>
</ul>
<p>Si esta pantalla no aparece supone que bien Apache o MySQL no están funcionado bien, y debemos volver a instalarlo.</p>
<p>Y por ultimo nos queda empezar a diseñar nuestros archivos html ,php, etc y poder practicar un poco en nuestra maquina local antes de lanzarnos a internet.</p>
<p><div style="float:left; text-align:left;><img alt='' src='http://1.gravatar.com/avatar/516ffa1373c8295d2e5ff5267fc53399?s=100&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><h3><a href='http://www.masquewordpress.com/author/Damian/' title='Damian'>Damian</a></h3><p>Programador en tiempos libres , amante de la tecnología, blogger amateur y emprendedor en sueños.</p><p><a href='http://www.masquewordpress.com/author/Damian/' title='M&aacute;s post de Damian'>M&aacute;s Posts de Damian</a>  - <a href='http://www.timersys.com' title='Damian'>Web</a> </p><p class="wpa-nomargin">Sigueme:<br /><a class='wpa-social-icons' href='http://www.twitter.com/chifliiiii'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/twitter.png' alt='Twitter'/></a><a class='wpa-social-icons' href='http://www.facebook.com/pages/Timersys/146687622031640'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/facebook.png' alt='Facebook'/></a><a class='wpa-social-icons' href='http://ar.linkedin.com/pub/damian-logghe/26/173/321'><img src='http://www.masquewordpress.com/wp-content/plugins/wp-about-author//images/linkedin.png' alt='LinkedIn'/></a></p></p>]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-instalar-apache-php-mysql-phpmyadmin-en-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

