<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Common queries</title>
	<atom:link href="http://www.wlscripting.com/tutorial/44/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wlscripting.com/tutorial/44</link>
	<description>PHP coding tutorials</description>
	<lastBuildDate>Tue, 27 Jul 2010 02:32:09 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-beta-1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel</title>
		<link>http://www.wlscripting.com/tutorial/44/comment-page-1#comment-185362</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Fri, 31 Jul 2009 18:59:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.wlscripting.com/tutorial/44#comment-185362</guid>
		<description>Writing some variables like $sql for queries is just something I have done for a while. It is just something I know exactly what it is and where it will be used. I reserve certain variables for certain types of code and that is just one of them I use personally.

Yes when creating a user authentication script you would want to limit 1 in your query since once you have found your record you don&#039;t need any others.</description>
		<content:encoded><![CDATA[<p>Writing some variables like $sql for queries is just something I have done for a while. It is just something I know exactly what it is and where it will be used. I reserve certain variables for certain types of code and that is just one of them I use personally.</p>
<p>Yes when creating a user authentication script you would want to limit 1 in your query since once you have found your record you don&#8217;t need any others.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rocky</title>
		<link>http://www.wlscripting.com/tutorial/44/comment-page-1#comment-185181</link>
		<dc:creator>Rocky</dc:creator>
		<pubDate>Sat, 25 Jul 2009 09:34:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.wlscripting.com/tutorial/44#comment-185181</guid>
		<description>why name it $sql when you can use the same name over and over and write it shorter, so it not only loads the string faster but takes up less room when editing the script?

$q = &quot;SELECT * FROM `table`&quot;;
$res = mysql_query($q);
or just run the query
mysql_query($q);

Also i have a question: 
When limiting to one row a example of this would be authentication right?

IF a user is authenticated we will have a query that selects from the usertable.

$q = &quot;SELECT * FROM `users`
WHERE `username`=&#039;EXAMPLE&#039; AND `password`=&#039;EXAMPLE&#039;&quot;;
(LIMIT 1) ?
$q = &quot;SELECT * FROM `users`
WHERE `username`=&#039;EXAMPLE&#039; AND `password`=&#039;EXAMPLE&#039; LIMIT 1&quot;;
// SELECT 1, ROW FROM `users` (WHERE)
Username &amp; PASSWORD ARE EQUAL TO OUR POST DATA?</description>
		<content:encoded><![CDATA[<p>why name it $sql when you can use the same name over and over and write it shorter, so it not only loads the string faster but takes up less room when editing the script?</p>
<p>$q = &#8220;SELECT * FROM `table`&#8221;;<br />
$res = mysql_query($q);<br />
or just run the query<br />
mysql_query($q);</p>
<p>Also i have a question:<br />
When limiting to one row a example of this would be authentication right?</p>
<p>IF a user is authenticated we will have a query that selects from the usertable.</p>
<p>$q = &#8220;SELECT * FROM `users`<br />
WHERE `username`=&#8217;EXAMPLE&#8217; AND `password`=&#8217;EXAMPLE&#8217;&#8221;;<br />
(LIMIT 1) ?<br />
$q = &#8220;SELECT * FROM `users`<br />
WHERE `username`=&#8217;EXAMPLE&#8217; AND `password`=&#8217;EXAMPLE&#8217; LIMIT 1&#8243;;<br />
// SELECT 1, ROW FROM `users` (WHERE)<br />
Username &amp; PASSWORD ARE EQUAL TO OUR POST DATA?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
