<?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>Bright Cherry &#187; MySQL &amp; PHP</title>
	<atom:link href="http://www.brightcherry.co.uk/scribbles/category/mysql-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightcherry.co.uk/scribbles</link>
	<description></description>
	<lastBuildDate>Fri, 27 Aug 2010 18:00:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>PHP / MySQL &#8211; Strip Content And Only Display Images From A MySQL Table</title>
		<link>http://www.brightcherry.co.uk/scribbles/2010/06/20/php-mysql-strip-content-and-only-display-images-from-a-mysql-table/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2010/06/20/php-mysql-strip-content-and-only-display-images-from-a-mysql-table/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 20:56:10 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[MySQL & PHP]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=231</guid>
		<description><![CDATA[This is another one of those quite specific pieces of code, so I doubt many people will need it. I think the code is quite useful, so I thought i&#8217;d make a post about it. Anyways, I&#8217;m going to show you how you can pull just images out of a field in a MySQL table. [...]]]></description>
			<content:encoded><![CDATA[<p>This is another one of those quite specific pieces of code, so I doubt many people will need it. I think the code is quite useful, so I thought i&#8217;d make a post about it. Anyways, I&#8217;m going to show you how you can pull just images out of a field in a MySQL table. I used this code yesterday, to specifically pull out all images from a WordPress Blog &#8211; to look at all the images that have been posted in ALL articles.</p>
<h5>What the following PHP/MySQL code will specifcally deliver&#8230;</h5>
<ul>
<li>It will pull out ONLY images</li>
<li>If one field has multiple images, it will display ALL of them</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p231code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2313"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p231code3"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//this query will only get the rows that have images in them</span>
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span>
<span style="color: #0000ff;">&quot;SELECT [field]
FROM [table]
WHERE [field] LIKE '%&lt;img src=&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//execute the query</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//loop the results</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_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">//this is the magic - preg_match matches all the images saves them into an array called images[]</span>
 <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/&lt;img[^&gt;]+&gt;/i'</span><span style="color: #339933;">,</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ENTER FIELD'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$images</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//echo out all the images</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$images</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That&#8217;s it! The print_r will show you all the images when you load the page. The preg_match_all line can actually be used with any string to pull out image references (or whatever regulat expression you require). I&#8217;m just specifcially demonstrating how I used it with WordPress/images.</p>
<p>If you don&#8217;t want to see the images, and just want to see the actual image URL&#8217;s, you can do the following&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p231code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p231code4"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//put the images[] array into a foreach loop</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$images</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$image</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">//because each entry may have multiple images, we have to loop through each row to get each image</span>
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//remove the &lt;img&gt; tag</span>
    <span style="color: #000088;">$img</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//explode each image by double quotes (or single quotes depending on how you quote your images), so we know where the image URL ends!</span>
    <span style="color: #000088;">$img</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//rename the image URL to $file for ease</span>
    <span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$img</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
   <span style="color: #666666; font-style: italic;">//echo out each image URL</span>
    <span style="color: #990000;">echo</span> <span style="color: #000088;">$file</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Please let mw know if anyone actually uses this code and how useful it was&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2010/06/20/php-mysql-strip-content-and-only-display-images-from-a-mysql-table/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP/MySQL- Escape All POST Or GET Variables For MySQL INSERT</title>
		<link>http://www.brightcherry.co.uk/scribbles/2010/02/16/phpmysql-make-all-post-or-get-variables-safe-for-mysql-insert/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2010/02/16/phpmysql-make-all-post-or-get-variables-safe-for-mysql-insert/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 19:26:58 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[MySQL & PHP]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=199</guid>
		<description><![CDATA[I&#8217;m quickly going to demonstrate how to escape special characters in a string for all POST/GET variables safe for a MySQL INSERT query when passing values from a HTML form. So, let&#8217;s say we have a form like this on index.php: Details First Name: Surname: Email: View Code HTML1 2 3 4 5 6 7 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m quickly going to demonstrate how to escape special characters in a string for all POST/GET variables safe for a MySQL INSERT query when passing values from a HTML form.</p>
<p>So, let&#8217;s say we have a form like this on <b class="pink">index.php</b>:</p>
<form action="insert.php" method="POST">
<fieldset>
<legend>Details<br />
<legend>
<div>
<label>First Name:</label>
</div>
<div>
<input type="input" name="first_name" value="Bright" disabled="disabled" />
</div>
<div>
<label>Surname:</label>
</div>
<div>
<input type="input" name="surname" value="Cherry" disabled="disabled" />
</div>
<div>
<label>Email:</label>
</div>
<div>
<input type="input" name="email" value="design@brightcherry.co.uk" disabled="disabled" />
</div>
<div style="margin-top:10px;">
<input disabled="disabled" type="submit" value="Submit" />
</div>
</fieldset>
</form>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p199code9'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1999"><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
</pre></td><td class="code" id="p199code9"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;insert.php&quot; method=&quot;POST&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;Details&lt;legend&gt;
&lt;div&gt;
&lt;label&gt;First Name:&lt;/label&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;input type=&quot;input&quot; name=&quot;first_name&quot; value=&quot;Bright&quot; disabled=&quot;disabled&quot; /&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label&gt;Surname:&lt;/label&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;input type=&quot;input&quot; name=&quot;surname&quot; value=&quot;Cherry&quot; disabled=&quot;disabled&quot; /&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label&gt;Email:&lt;/label&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;input type=&quot;input&quot; name=&quot;email&quot; value=&quot;design@brightcherry.co.uk&quot; disabled=&quot;disabled&quot; /&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-top:10px;&quot;&gt;
&lt;input disabled=&quot;disabled&quot; type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
&lt;/div&gt;
&lt;/fieldset&gt;
&lt;/form&gt;</pre></td></tr></table></div>

<p>The form&#8217;s action is <b class="pink">insert.php</b>, so whichever method you choose (GET/POST) will get passed to insert.php. Now, before you INSERT the data into a MySQL table, you should ensure the data is safe to INSERT.</p>
<p>The PHP function you should use is <a href="http://php.net/manual/en/function.mysql-real-escape-string.php" title="PHP function: mysql_real_escape_string" rel="nofollow">mysql_real_escape_string</a>. </p>
<p>You can do the following before inserting the data (assuming the method type is POST):</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p199code10'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p19910"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p199code10"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_name'</span><span style="color: #009900;">&#93;</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;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'surname'</span><span style="color: #009900;">&#93;</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;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'surname'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</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;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>But that&#8217;s not a very efficient method because you&#8217;re repeating the same function over and over, and if the form you&#8217;re using has a lot more fields, it will quickly become very problematic for a number of reasons.</p>
<p>Here&#8217;s a better and more efficient way of cleaning the data:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p199code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p19911"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p199code11"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_keys</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$clean</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</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;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>So what&#8217;s happening now is that ALL the POST variables are being cleaned in the <b class="pink">foreach</b> loop. You&#8217;re also renaming the POST values to $clean, but keeping the actual key value the same &#8211; so to echo the values you simply do this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p199code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p19912"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p199code12"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">echo</span> <span style="color: #000088;">$clean</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #000088;">$clean</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'surname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #000088;">$clean</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>It&#8217;s as easy as that <img src='http://www.brightcherry.co.uk/scribbles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2010/02/16/phpmysql-make-all-post-or-get-variables-safe-for-mysql-insert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &amp; PHP- Show Tables In Database</title>
		<link>http://www.brightcherry.co.uk/scribbles/2008/11/14/mysql-php-show-tables-in-database/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2008/11/14/mysql-php-show-tables-in-database/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 09:01:00 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[MySQL & PHP]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=94</guid>
		<description><![CDATA[Someone asked me the other day how to display the existing tables in their database with a PHP script. The query itself is pretty simple, but people seem to get confused about the PHP side of it. Then again, once you look at the code, you might be surprised how easy it really is&#8230; Printing [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked me the other day how to display the existing tables in their database with a PHP script. The query itself is pretty simple, but people seem to get confused about the PHP side of it. Then again, once you look at the code, you might be surprised how easy it really is&#8230;</p>
<h4>Printing tables with PHP</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p94code15'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p9415"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p94code15"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$showtablequery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
	SHOW TABLES
	FROM
	[database]
	&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$showtablequery_result</span>	<span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$showtablequery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$showtablerow</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$showtablequery_result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #000088;">$showtablerow</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>That query will show ALL tables, but you can use a LIKE function in the query as well, to get particular tables only.</p>
<h4>Printing particular tables with PHP</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p94code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p9416"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p94code16"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$showtablequery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
	SHOW TABLES
	FROM
	[database]
	LIKE
	'<span style="color: #009933; font-weight: bold;">%b</span>rightcherry%'
	&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$showtablequery_result</span>	<span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$showtablequery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$showtablerow</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$showtablequery_result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #000088;">$showtablerow</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>That query will pull out all tables with the word &#8216;brightcherry&#8217; in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2008/11/14/mysql-php-show-tables-in-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
