<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Hot Scripts Forums - Database</title>
		<link>http://www.hotscripts.com/forums/</link>
		<description>General database discussion including setup, connecting, troubleshooting and any other issue you might have can be found/posted here!</description>
		<language>en</language>
		<lastBuildDate>Mon, 23 Nov 2009 09:44:01 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://cdn.hotscripts.com/forums/hsforum/misc/rss.jpg</url>
			<title>Hot Scripts Forums - Database</title>
			<link>http://www.hotscripts.com/forums/</link>
		</image>
		<item>
			<title>Database select querry</title>
			<link>http://www.hotscripts.com/forums/showthread.php?t=55943&amp;goto=newpost</link>
			<pubDate>Fri, 20 Nov 2009 23:14:01 GMT</pubDate>
			<description><![CDATA[Hi 
I have a working database and search facility that I need to refine a bit but am having problem with 
. 
PHP: 
--------- 
$query = "SELECT  
	model,  
	brand,  
	gc_number,  
	dir,]]></description>
			<content:encoded><![CDATA[<div>Hi<br />
I have a working database and search facility that I need to refine a bit but am having problem with<br />
.<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;model,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;brand,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;gc_number,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;dir,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;manuals_pdffiles.id,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;pdf_file,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;category,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;pdf_info,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;DATE_FORMAT(date_available,&nbsp;'%d&nbsp;%b&nbsp;%y')&nbsp;AS&nbsp;Fdate,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;safety,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;asbestos,<br />&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;<br />FROM&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;manuals_models&nbsp;<br />LEFT&nbsp;JOIN&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;manuals_pdffiles&nbsp;ON&nbsp;manual_id&nbsp;=&nbsp;manuals_pdffiles.id&nbsp;<br />LEFT&nbsp;JOIN&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;manuals_brands&nbsp;ON&nbsp;brand_id&nbsp;=&nbsp;manuals_brands.id&nbsp;<br />WHERE&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;(model&nbsp;like&nbsp;'%$entry%')&nbsp;AND&nbsp;class&nbsp;=&nbsp;1&nbsp;<br />ORDER&nbsp;BY&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;brand,&nbsp;model&nbsp;"</span><span style="color: #007700">;&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>The field 'models' might contain an entry such as &quot;Potterton Puma 80e&quot;  and if the site visitor enters a search string ($entry) enters say &quot;puma 80e&quot; the select statement returns the correct entry. If they enter &quot;puma 80 e&quot; it doesn't obviously.<br />
<br />
I can easily modify the search string $entry to remove all the spaces but how do I modify the WHERE statement so that the database entry 'model' is also minus any spaces?<br />
<br />
Using the above example then 'model' would end up as &quot;PottertonPuma80e&quot; and the search string would be &quot;puma80e&quot;. Then if site visitor added extra spaces (or left any out) the select statement would find the entry?<br />
<br />
Hope that makes sence!!</div>

]]></content:encoded>
			<category domain="http://www.hotscripts.com/forums/forumdisplay.php?f=155">Database</category>
			<dc:creator>alane</dc:creator>
			<guid isPermaLink="true">http://www.hotscripts.com/forums/showthread.php?t=55943</guid>
		</item>
		<item>
			<title>SQL query question</title>
			<link>http://www.hotscripts.com/forums/showthread.php?t=55772&amp;goto=newpost</link>
			<pubDate>Thu, 05 Nov 2009 16:05:19 GMT</pubDate>
			<description><![CDATA[Hi there 
 
I'm trying to establish if the following is possible using SQL on it's own (I know it can be done by means of scripting) 
 
I have the following table 
 
 
Code: 
--------- 
year (int)]]></description>
			<content:encoded><![CDATA[<div>Hi there<br />
<br />
I'm trying to establish if the following is possible using SQL on it's own (I know it can be done by means of scripting)<br />
<br />
I have the following table<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">year (int)<br />
course (string)<br />
rep_id (int)</code><hr />
</div>The table describes &quot;course representitives&quot; in a particular year. I'm trying to find a way to list the rep_id of all reps who have been a rep in 2 consecutive years. I can't for the life of me establish the SQL.<br />
<br />
Hope someone can help. <br />
<br />
<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://www.hotscripts.com/forums/forumdisplay.php?f=155">Database</category>
			<dc:creator>landing</dc:creator>
			<guid isPermaLink="true">http://www.hotscripts.com/forums/showthread.php?t=55772</guid>
		</item>
		<item>
			<title>Report Post This simple joing mysql select return many duplicate results</title>
			<link>http://www.hotscripts.com/forums/showthread.php?t=55671&amp;goto=newpost</link>
			<pubDate>Tue, 27 Oct 2009 18:09:28 GMT</pubDate>
			<description><![CDATA[I've problem with this query : 
MySQL pastebin - collaborative debugging tool (http://pastebin.com/d41a87b78) , 
 
It returns many duplicated results , 
here's image : Imageshack - mysqlun - Uploaded by alex_funky_dj (http://img26.imageshack.us/i/mysqlun.jpg/)]]></description>
			<content:encoded><![CDATA[<div>I've problem with this query :<br />
<a href="http://pastebin.com/d41a87b78" target="_blank">MySQL pastebin - collaborative debugging tool</a> ,<br />
<br />
It returns many duplicated results ,<br />
here's image : <a href="http://img26.imageshack.us/i/mysqlun.jpg/" target="_blank">Imageshack - mysqlun - Uploaded by alex_funky_dj</a></div>

]]></content:encoded>
			<category domain="http://www.hotscripts.com/forums/forumdisplay.php?f=155">Database</category>
			<dc:creator>m_abdelfattah</dc:creator>
			<guid isPermaLink="true">http://www.hotscripts.com/forums/showthread.php?t=55671</guid>
		</item>
		<item>
			<title>case sensitive search with MATCH AGAINST along with ID</title>
			<link>http://www.hotscripts.com/forums/showthread.php?t=55670&amp;goto=newpost</link>
			<pubDate>Tue, 27 Oct 2009 16:17:30 GMT</pubDate>
			<description><![CDATA[case sensitive search with MATCH AGAINST along with ID 
 
Here is my sql: 
 
PHP: 
--------- 
$filterstr = sqlstr($filter); 
  if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%"; 
  $sql = "SELECT COUNT(*) FROM `description`"; 
  if (isset($filterstr) &&...]]></description>
			<content:encoded><![CDATA[<div>case sensitive search with MATCH AGAINST along with ID<br />
<br />
Here is my sql:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">$filterstr&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sqlstr</span><span style="color: #007700">(</span><span style="color: #0000BB">$filter</span><span style="color: #007700">);<br />&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">$wholeonly&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;isset(</span><span style="color: #0000BB">$wholeonly</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$filterstr</span><span style="color: #007700">!=</span><span style="color: #DD0000">''</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">$filterstr&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"%"&nbsp;</span><span style="color: #007700">.</span><span style="color: #0000BB">$filterstr&nbsp;</span><span style="color: #007700">.</span><span style="color: #DD0000">"%"</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;COUNT(*)&nbsp;FROM&nbsp;`description`"</span><span style="color: #007700">;<br />&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">$filterstr</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$filterstr</span><span style="color: #007700">!=</span><span style="color: #DD0000">''&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;isset(</span><span style="color: #0000BB">$filterfield</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$filterfield</span><span style="color: #007700">!=</span><span style="color: #DD0000">''</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"&nbsp;where&nbsp;"&nbsp;</span><span style="color: #007700">.</span><span style="color: #0000BB">sqlstr</span><span style="color: #007700">(</span><span style="color: #0000BB">$filterfield</span><span style="color: #007700">)&nbsp;.</span><span style="color: #DD0000">"&nbsp;like&nbsp;'"&nbsp;</span><span style="color: #007700">.</span><span style="color: #0000BB">$filterstr&nbsp;</span><span style="color: #007700">.</span><span style="color: #DD0000">"'"</span><span style="color: #007700">;<br />&nbsp;&nbsp;}&nbsp;elseif&nbsp;(isset(</span><span style="color: #0000BB">$filterstr</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$filterstr</span><span style="color: #007700">!=</span><span style="color: #DD0000">''</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"&nbsp;where&nbsp;&nbsp;MATCH&nbsp;(ID&nbsp;,&nbsp;SERIES_NUM&nbsp;,TITLE,DESCRIPTION,CATEGORY,`TYPE`,VERSION,MEDIA_TYPE,PLATFORM,DATE,FILENAME)&nbsp;AGAINST&nbsp;('+$filterstr&nbsp;-$filterstr'&nbsp;IN&nbsp;BOOLEAN&nbsp;MODE);&nbsp;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$res&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_assoc</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">reset</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">);<br />&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">current</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>If i REMOVE ID from the MATCH...case sensitivity goes away. if i put it back in, case sensitivity comes back...how can i get around this?  I need to search the ID as well without case sensitivity.<br />
<br />
Im using MySQL 5.1.36</div>

]]></content:encoded>
			<category domain="http://www.hotscripts.com/forums/forumdisplay.php?f=155">Database</category>
			<dc:creator>tooletime</dc:creator>
			<guid isPermaLink="true">http://www.hotscripts.com/forums/showthread.php?t=55670</guid>
		</item>
		<item>
			<title>Database Name issue</title>
			<link>http://www.hotscripts.com/forums/showthread.php?t=55648&amp;goto=newpost</link>
			<pubDate>Mon, 26 Oct 2009 15:12:39 GMT</pubDate>
			<description>Hi there, 
 
is it possible to get the name of the database from the data? 
I search my DB with full-text-search.. 
 
now I want to link from the results, but I need the name of the 
table the result was found in. I use that back in the URL to link.. 
 
F.E.</description>
			<content:encoded><![CDATA[<div>Hi there,<br />
<br />
is it possible to get the name of the database from the data?<br />
I search my DB with full-text-search..<br />
<br />
now I want to link from the results, but I need the name of the<br />
table the result was found in. I use that back in the URL to link..<br />
<br />
F.E.<br />
<br />
search for: &quot;Example Search&quot; in my DB<br />
In table 1 this is found, I need the name of table 1 to use..<br />
<br />
Hope this comes a bit clear to someone...<br />
<br />
_j</div>

]]></content:encoded>
			<category domain="http://www.hotscripts.com/forums/forumdisplay.php?f=155">Database</category>
			<dc:creator>jonnekke</dc:creator>
			<guid isPermaLink="true">http://www.hotscripts.com/forums/showthread.php?t=55648</guid>
		</item>
	</channel>
</rss>
