<?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>PHPBuilder.com - Database</title>
		<link>http://board.phpbuilder.com/</link>
		<description>Conversation regarding PHP and SQL</description>
		<language>en</language>
		<lastBuildDate>Mon, 20 May 2013 02:51:26 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://board.phpbuilder.com/images/misc/rss.png</url>
			<title>PHPBuilder.com - Database</title>
			<link>http://board.phpbuilder.com/</link>
		</image>
		<item>
			<title>Query with joins, count()s and sum() producing odd results</title>
			<link>http://board.phpbuilder.com/showthread.php?10389711-Query-with-joins-count()s-and-sum()-producing-odd-results&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 01:22:31 GMT</pubDate>
			<description><![CDATA[Well, probably not "odd" - much more likely bad SQL on my part.

I'm attempting to get a list of all customers, and get each customer's count of orders from the order table, count of cart items from the cart items table, and sum of store credit from the credits table.

=====================================

SELECT c.*, SUM(sc.amount) AS creditTotal, COUNT(o.orderId) AS orders, MAX(o.orderDate) AS lastOrder FROM customers c LEFT JOIN storeCredits sc ON c.customerId=sc.customerId LEFT JOIN orders o ON c.customerId=o.customerId GROUP BY c.customerId ORDER BY c.lastName ASC 

This gets me an "orders" count of 4 for my second customer, which is correct. But when I join cartItems to the query I get an orders count of 8, and a cartItemCount of 8 (should be 2).

SELECT c.*, SUM(sc.amount) AS creditTotal, COUNT(o.orderId) AS orders, MAX(o.orderDate) AS lastOrder, COUNT(ci.cartItemId) AS cartItemCount FROM customers c LEFT JOIN storeCredits sc ON c.customerId=sc.customerId LEFT JOIN orders o ON c.customerId=o.customerId LEFT JOIN cartItems ci ON c.customerId=ci.customerId GROUP BY c.customerId ORDER BY c.lastName ASC 

It's definitely adding the last LEFT JOIN that's messing things up, not adding to the SELECT statement. It seems to be multiplying the COUNT items within the query by each other (4 x 2) instead of keeping them isolated and separate.

Any tips?]]></description>
			<content:encoded><![CDATA[<div>Well, probably not &quot;odd&quot; - much more likely bad SQL on my part.<br />
<br />
I'm attempting to get a list of all customers, and get each customer's count of orders from the order table, count of cart items from the cart items table, and sum of store credit from the credits table.<br />
<br />
=====================================<br />
<br />
SELECT c.*, SUM(sc.amount) AS creditTotal, COUNT(o.orderId) AS orders, MAX(o.orderDate) AS lastOrder FROM customers c LEFT JOIN storeCredits sc ON c.customerId=sc.customerId LEFT JOIN orders o ON c.customerId=o.customerId GROUP BY c.customerId ORDER BY c.lastName ASC <br />
<br />
This gets me an &quot;orders&quot; count of 4 for my second customer, which is correct. But when I join cartItems to the query I get an orders count of 8, and a cartItemCount of 8 (should be 2).<br />
<br />
SELECT c.*, SUM(sc.amount) AS creditTotal, COUNT(o.orderId) AS orders, MAX(o.orderDate) AS lastOrder, COUNT(ci.cartItemId) AS cartItemCount FROM customers c LEFT JOIN storeCredits sc ON c.customerId=sc.customerId LEFT JOIN orders o ON c.customerId=o.customerId LEFT JOIN cartItems ci ON c.customerId=ci.customerId GROUP BY c.customerId ORDER BY c.lastName ASC <br />
<br />
It's definitely adding the last LEFT JOIN that's messing things up, not adding to the SELECT statement. It seems to be multiplying the COUNT items within the query by each other (4 x 2) instead of keeping them isolated and separate.<br />
<br />
Any tips?</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>bunner bob</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389711-Query-with-joins-count()s-and-sum()-producing-odd-results</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] Row 10 no displaying]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389703-RESOLVED-Row-10-no-displaying&amp;goto=newpost</link>
			<pubDate>Tue, 14 May 2013 15:05:26 GMT</pubDate>
			<description><![CDATA[I hopefully seem to be getting somewhere from my last post about creating a database script.  But now I seem to be getting an error with the following:


Code:
---------
Notice: Undefined offset: 10 in /var/www/mysite/include/config.php on line 126
---------
So its this *line 126* that the output will not produce:


Code:
---------
 $price = $col[10];
---------
I ran the query in phpmyadmin to make sure it was working:

SQL result

Host: localhost
Database: mydb
Generation Time: May 14, 2013 at 04:56 PM
Generated by: phpMyAdmin 3.5.8.1deb1 / MySQL 5.5.31-0ubuntu0.13.04.1
SQL query: SELECT * FROM packages WHERE service = 'books' LIMIT 1; 
Rows: 1

service	plan	  title	author descr type language paperback currency price
books 	weekly a	b	  c	  d     e            f             g            h

Here is the code:


PHP:
---------

$book_query = ("SELECT * FROM packages WHERE service = ? LIMIT 1");
if(!$book_stmt = $pdo->prepare($host_query)){
    // prepare failed
    echo "<pre>Prepare failed:\n";
    print_r($pdo->errorInfo());
    echo "</pre>";
} else {
    if(!$book_stmt->execute(array('books'))){
        // execute failed
        echo "<pre>Execute failed:\n";
        print_r($book_stmt->errorInfo());
        echo "</pre>";
    } else {
        // query ran without any errors, you can test if it returned any rows and use them here
        
    }
}
// Database  

if ($book_stmt->rowCount() > 0) {
    while ($col = $book_stmt->fetch())
    {
    $title = $col[3];
    $author = $col[4];
    $descr = $col[5];
    $type = $col[6];
    $language = $col[7];
    $paperback = $col[8];
    $currency = $col[9];
    $price = $col[10];
    

    }

} else {

    $title = 'no data';
    $author = 'no data';
    $descr = 'no data';
    $type = 'no data';
    $language = 'no data';
    $paperback = 'no data';
    $currency = 'no data';
    $price = 'no data';

}
---------


What can I do to correct this?]]></description>
			<content:encoded><![CDATA[<div>I hopefully seem to be getting somewhere from my last post about creating a database script.  But now I seem to be getting an error with the following:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Notice: Undefined offset: 10 in /var/www/mysite/include/config.php on line 126</code><hr />
</div> So its this <b>line 126</b> that the output will not produce:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"> $price = $col[10];</code><hr />
</div> I ran the query in phpmyadmin to make sure it was working:<br />
<br />
SQL result<br />
<br />
Host: localhost<br />
Database: mydb<br />
Generation Time: May 14, 2013 at 04:56 PM<br />
Generated by: phpMyAdmin 3.5.8.1deb1 / MySQL 5.5.31-0ubuntu0.13.04.1<br />
SQL query: SELECT * FROM packages WHERE service = 'books' LIMIT 1; <br />
Rows: 1<br />
<br />
service	plan	  title	author descr type language paperback currency price<br />
books 	weekly a	b	  c	  d     e            f             g            h<br />
<br />
Here is the code:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"><br />$book_query&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;packages&nbsp;WHERE&nbsp;service&nbsp;=&nbsp;?&nbsp;LIMIT&nbsp;1"</span><span style="color: #007700">);<br />if(!</span><span style="color: #0000BB">$book_stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$pdo</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$host_query</span><span style="color: #007700">)){<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;prepare&nbsp;failed<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"&lt;pre&gt;Prepare&nbsp;failed:\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$pdo</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errorInfo</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/pre&gt;"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">$book_stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'books'</span><span style="color: #007700">))){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;execute&nbsp;failed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"&lt;pre&gt;Execute&nbsp;failed:\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$book_stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errorInfo</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/pre&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;query&nbsp;ran&nbsp;without&nbsp;any&nbsp;errors,&nbsp;you&nbsp;can&nbsp;test&nbsp;if&nbsp;it&nbsp;returned&nbsp;any&nbsp;rows&nbsp;and&nbsp;use&nbsp;them&nbsp;here<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}<br />}<br /></span><span style="color: #FF8000">//&nbsp;Database&nbsp;&nbsp;<br /><br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$book_stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCount</span><span style="color: #007700">()&nbsp;&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$col&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$book_stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$title&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">3</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$author&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">4</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$descr&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">5</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$type&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">6</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$language&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">7</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$paperback&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">8</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$currency&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">9</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$price&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$col</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">10</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />}&nbsp;else&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$title&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$author&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$descr&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$type&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$language&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$paperback&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$currency&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$price&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;data'</span><span style="color: #007700">;<br /><br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> <br />
<br />
What can I do to correct this?</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>chrisguk</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389703-RESOLVED-Row-10-no-displaying</guid>
		</item>
		<item>
			<title>Is my select statement secure enough?</title>
			<link>http://board.phpbuilder.com/showthread.php?10389701-Is-my-select-statement-secure-enough&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 14:37:20 GMT</pubDate>
			<description><![CDATA[I have thrown together the following, with a few snippets pulled from various places.  Is it ok to use without the worry of sql injection?


PHP:
---------

try {
  // Connect and create the PDO object
  $conn = new PDO("mysql:host=$hostdb; dbname=$namedb", $userdb, $passdb);
  $conn->exec("SET CHARACTER SET utf8");      // Sets encoding UTF-8

  // Define and perform the SQL SELECT query
  $sql = "SELECT * FROM `db_linux`";
  $result = $conn->query($sql);

  // If the SQL query is successfully performed ($result not false)
  if($result !== false) {
    $cols = $result->columnCount();           // Number of returned columns

    // Parse the result set
   if ($sql->num_rows > 0) {
    while ($row = $sql->fetch_object())
    {
        $plan = $row->plan;
        $name = $row->name;
        $text = $row->text;

    }

} else {

    
    $plan = 'no plan';
    $name = 'NA';
    $text = 'NA2';

} 
    
    
  }
---------
]]></description>
			<content:encoded><![CDATA[<div>I have thrown together the following, with a few snippets pulled from various places.  Is it ok to use without the worry of sql injection?<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"><br /></span><span style="color: #007700">try&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Connect&nbsp;and&nbsp;create&nbsp;the&nbsp;PDO&nbsp;object<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$conn&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">(</span><span style="color: #DD0000">"mysql:host=</span><span style="color: #0000BB">$hostdb</span><span style="color: #DD0000">;&nbsp;dbname=</span><span style="color: #0000BB">$namedb</span><span style="color: #DD0000">"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$userdb</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$passdb</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">exec</span><span style="color: #007700">(</span><span style="color: #DD0000">"SET&nbsp;CHARACTER&nbsp;SET&nbsp;utf8"</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Sets&nbsp;encoding&nbsp;UTF-8<br /><br />&nbsp;&nbsp;//&nbsp;Define&nbsp;and&nbsp;perform&nbsp;the&nbsp;SQL&nbsp;SELECT&nbsp;query<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;`db_linux`"</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;If&nbsp;the&nbsp;SQL&nbsp;query&nbsp;is&nbsp;successfully&nbsp;performed&nbsp;($result&nbsp;not&nbsp;false)<br />&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cols&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columnCount</span><span style="color: #007700">();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Number&nbsp;of&nbsp;returned&nbsp;columns<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Parse&nbsp;the&nbsp;result&nbsp;set<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">num_rows&nbsp;</span><span style="color: #007700">&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$sql</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch_object</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$plan&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">plan</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$text&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">text</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />}&nbsp;else&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$plan&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'no&nbsp;plan'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'NA'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$text&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'NA2'</span><span style="color: #007700">;<br /><br />}&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>chrisguk</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389701-Is-my-select-statement-secure-enough</guid>
		</item>
		<item>
			<title>MYSQL Update</title>
			<link>http://board.phpbuilder.com/showthread.php?10389699-MYSQL-Update&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 11:23:59 GMT</pubDate>
			<description><![CDATA[HI

Im using the following to update databases


PHP:
---------
MYSQL_QUERY( "insert into $table1 SELECT * FROM $table2 where 1 ");
---------
  


There are 24 fields in each table, my problem is if a reference number ( ie. R12121 ) exists in table1 i want it to update and not add new record, how can this be done?]]></description>
			<content:encoded><![CDATA[<div>HI<br />
<br />
Im using the following to update databases<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">MYSQL_QUERY</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">"insert&nbsp;into&nbsp;</span><span style="color: #0000BB">$table1</span><span style="color: #DD0000">&nbsp;SELECT&nbsp;*&nbsp;FROM&nbsp;</span><span style="color: #0000BB">$table2</span><span style="color: #DD0000">&nbsp;where&nbsp;1&nbsp;"</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> <br />
There are 24 fields in each table, my problem is if a reference number ( ie. R12121 ) exists in table1 i want it to update and not add new record, how can this be done?</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>leewad</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389699-MYSQL-Update</guid>
		</item>
		<item>
			<title>Possible pagination approach with PDO</title>
			<link>http://board.phpbuilder.com/showthread.php?10389667-Possible-pagination-approach-with-PDO&amp;goto=newpost</link>
			<pubDate>Thu, 09 May 2013 19:53:35 GMT</pubDate>
			<description><![CDATA[Just want to run this idea past any interested parties for thoughts on validity and correctness. Basic issue is I'm looking at some code that essentially runs the same query -- one that's pretty ugly and not terribly quick -- once to get the data to be displayed on the page (based on pagination offset/limit), then again to get the total count (so pagination knows how many pages there are. Here's the basic process I'm thinking of using to do it in one query:

PHP:
---------
<?php

// sample pagination values from some input or other
$offset = 20;
$numPerPage = 10;

$sql = "some complex query that takes more time than I'd like";
$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$stmt->execute();
// to be used by pagination functions for total items:
$totalRows = $stmt->rowCount();
// populate array of data to be displayed on this page:
$data = array();
for($ix = 0; $ix++; $ix < $numPerPage) {
	$row = $stmt->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_ABS, $offset + $ix);
	if($row != false) {
		$data[] = $row;
	}
	else {
		break;
	}
}
---------
Thoughts? Suggestions?]]></description>
			<content:encoded><![CDATA[<div>Just want to run this idea past any interested parties for thoughts on validity and correctness. Basic issue is I'm looking at some code that essentially runs the same query -- one that's pretty ugly and not terribly quick -- once to get the data to be displayed on the page (based on pagination offset/limit), then again to get the total count (so pagination knows how many pages there are. Here's the basic process I'm thinking of using to do it in one query:<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;sample&nbsp;pagination&nbsp;values&nbsp;from&nbsp;some&nbsp;input&nbsp;or&nbsp;other<br /></span><span style="color: #0000BB">$offset&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">20</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$numPerPage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"some&nbsp;complex&nbsp;query&nbsp;that&nbsp;takes&nbsp;more&nbsp;time&nbsp;than&nbsp;I'd&nbsp;like"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$pdo</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">ATTR_CURSOR&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">CURSOR_SCROLL</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">//&nbsp;to&nbsp;be&nbsp;used&nbsp;by&nbsp;pagination&nbsp;functions&nbsp;for&nbsp;total&nbsp;items:<br /></span><span style="color: #0000BB">$totalRows&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCount</span><span style="color: #007700">();<br /></span><span style="color: #FF8000">//&nbsp;populate&nbsp;array&nbsp;of&nbsp;data&nbsp;to&nbsp;be&nbsp;displayed&nbsp;on&nbsp;this&nbsp;page:<br /></span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;array();<br />for(</span><span style="color: #0000BB">$ix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$ix</span><span style="color: #007700">++;&nbsp;</span><span style="color: #0000BB">$ix&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">$numPerPage</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_NUM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">FETCH_ORI_ABS</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$offset&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">$ix</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">&#91;&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></code><hr />
</div> Thoughts? Suggestions?</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>NogDog</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389667-Possible-pagination-approach-with-PDO</guid>
		</item>
		<item>
			<title>Max date query</title>
			<link>http://board.phpbuilder.com/showthread.php?10389663-Max-date-query&amp;goto=newpost</link>
			<pubDate>Thu, 09 May 2013 10:30:01 GMT</pubDate>
			<description><![CDATA[Hello,

I can't firgure out how to do the following:

table 1:

customerid
name

table 2:

...
customerid
date

Customers can have multiple entries in table 2.

I want to find all customers for which the latest date in the date column is longer ago then 30 days.

I belief to return the latest date you can use MAX(date) and the 30 days interval can be checked like: date < NOW() - INTERVAL 30 DAY

But how to put the two together in a single query?

Any help would be very much appreciated, thanks!]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I can't firgure out how to do the following:<br />
<br />
table 1:<br />
<br />
customerid<br />
name<br />
<br />
table 2:<br />
<br />
...<br />
customerid<br />
date<br />
<br />
Customers can have multiple entries in table 2.<br />
<br />
I want to find all customers for which the latest date in the date column is longer ago then 30 days.<br />
<br />
I belief to return the latest date you can use MAX(date) and the 30 days interval can be checked like: date &lt; NOW() - INTERVAL 30 DAY<br />
<br />
But how to put the two together in a single query?<br />
<br />
Any help would be very much appreciated, thanks!</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>safra</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389663-Max-date-query</guid>
		</item>
		<item>
			<title>nested query ??</title>
			<link>http://board.phpbuilder.com/showthread.php?10389637-nested-query&amp;goto=newpost</link>
			<pubDate>Mon, 06 May 2013 20:15:04 GMT</pubDate>
			<description><![CDATA[Here's what I'm trying to accomplish:


PHP:
---------
SELECT * FROM TOAWorkOrders WHERE 
(WorkDate = '$WorkDate' AND TechNum = '$TechNum') 
AND 
(Type != 'Lunch' OR Type != 'Break') order by Type
---------
I have found this from a few sources, but I can't figure out how to put them into practice.


PHP:
---------
$query = "SELECT * FROM TOAWorkOrders WHERE TechNum = '$TechNum' AND WorkDate = '$IncDate'";
$query .= "SELECT * FROM TOAWorkOrders WHERE Type != 'Lunch' OR Type != 'Break'";
								
if ($result3 = $mysqli->multi_query($query));
{	
    $WorkOrders[$Count] = $result3->num_rows;
     $SubWorkOrders = $SubWorkOrders + $WorkOrders[$Count];
}
---------
Help!!

I have my favorite shotgun, a box of ammo, and a faithful black lab at my side.  Man, it's cold out here.]]></description>
			<content:encoded><![CDATA[<div>Here's what I'm trying to accomplish:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">SELECT&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">FROM&nbsp;TOAWorkOrders&nbsp;WHERE&nbsp;<br /></span><span style="color: #007700">(</span><span style="color: #0000BB">WorkDate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'$WorkDate'&nbsp;</span><span style="color: #007700">AND&nbsp;</span><span style="color: #0000BB">TechNum&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'$TechNum'</span><span style="color: #007700">)&nbsp;<br />AND&nbsp;<br />(</span><span style="color: #0000BB">Type&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #DD0000">'Lunch'&nbsp;</span><span style="color: #007700">OR&nbsp;</span><span style="color: #0000BB">Type&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #DD0000">'Break'</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">order&nbsp;by&nbsp;Type&nbsp;<br /></span>
</span>
</code></code><hr />
</div> I have found this from a few sources, but I can't figure out how to put them into practice.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;TOAWorkOrders&nbsp;WHERE&nbsp;TechNum&nbsp;=&nbsp;'</span><span style="color: #0000BB">$TechNum</span><span style="color: #DD0000">'&nbsp;AND&nbsp;WorkDate&nbsp;=&nbsp;'</span><span style="color: #0000BB">$IncDate</span><span style="color: #DD0000">'"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;TOAWorkOrders&nbsp;WHERE&nbsp;Type&nbsp;!=&nbsp;'Lunch'&nbsp;OR&nbsp;Type&nbsp;!=&nbsp;'Break'"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />if&nbsp;(</span><span style="color: #0000BB">$result3&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">multi_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">));<br />{&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$WorkOrders</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$Count</span><span style="color: #007700">&#93;&nbsp;=&nbsp;</span><span style="color: #0000BB">$result3</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">num_rows</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$SubWorkOrders&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$SubWorkOrders&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">$WorkOrders</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$Count</span><span style="color: #007700">&#93;;<br />}&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> Help!!<br />
<br />
I have my favorite shotgun, a box of ammo, and a faithful black lab at my side.  Man, it's cold out here.</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>timstring</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389637-nested-query</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] Using alias column names]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389627-RESOLVED-Using-alias-column-names&amp;goto=newpost</link>
			<pubDate>Mon, 06 May 2013 12:54:20 GMT</pubDate>
			<description><![CDATA[Hi all,

Having looked around for some time I can't find any previous posts which can help me solve my issue.

I have an MySQl table in which I use an "if" statement to change the data displayed in one of the columns.

The process kind of works but the column header contains the "if" statement. This is the query:


PHP:
---------

f.fn AS 'FND',
date_format(d.st, '%'H:%i) AS stm,
d.al aS 'ALN',
if(d.ad = 'x', 'I','O')
FROM Table1 f, Table2 d
WHERE f.fn = d.nfn
ORDER BY d.st
---------
When the daya is displayed the column which holds the content of d.ad shows the column header "if(d.ad = 'x', 'I','O')" and not the colum name.

Can anyone give me some advise.

Thanks

Blackbox]]></description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
Having looked around for some time I can't find any previous posts which can help me solve my issue.<br />
<br />
I have an MySQl table in which I use an &quot;if&quot; statement to change the data displayed in one of the columns.<br />
<br />
The process kind of works but the column header contains the &quot;if&quot; statement. This is the query:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"><br />f</span><span style="color: #007700">.</span><span style="color: #0000BB">fn&nbsp;</span><span style="color: #007700">AS&nbsp;</span><span style="color: #DD0000">'FND'</span><span style="color: #007700">,<br /></span><span style="color: #0000BB">date_format</span><span style="color: #007700">(</span><span style="color: #0000BB">d</span><span style="color: #007700">.</span><span style="color: #0000BB">st</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'%'</span><span style="color: #0000BB">H</span><span style="color: #007700">:%</span><span style="color: #0000BB">i</span><span style="color: #007700">)&nbsp;AS&nbsp;</span><span style="color: #0000BB">stm</span><span style="color: #007700">,<br /></span><span style="color: #0000BB">d</span><span style="color: #007700">.</span><span style="color: #0000BB">al&nbsp;</span><span style="color: #007700">aS&nbsp;</span><span style="color: #DD0000">'ALN'</span><span style="color: #007700">,<br />if(</span><span style="color: #0000BB">d</span><span style="color: #007700">.</span><span style="color: #0000BB">ad&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'x'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'I'</span><span style="color: #007700">,</span><span style="color: #DD0000">'O'</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">FROM&nbsp;Table1&nbsp;f</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Table2&nbsp;d<br />WHERE&nbsp;f</span><span style="color: #007700">.</span><span style="color: #0000BB">fn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">d</span><span style="color: #007700">.</span><span style="color: #0000BB">nfn<br />ORDER&nbsp;BY&nbsp;d</span><span style="color: #007700">.</span><span style="color: #0000BB">st&nbsp;<br /></span>
</span>
</code></code><hr />
</div> When the daya is displayed the column which holds the content of d.ad shows the column header &quot;if(d.ad = 'x', 'I','O')&quot; and not the colum name.<br />
<br />
Can anyone give me some advise.<br />
<br />
Thanks<br />
<br />
Blackbox</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>blackbox</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389627-RESOLVED-Using-alias-column-names</guid>
		</item>
		<item>
			<title>After Log in, Pull Course Information Help! Please</title>
			<link>http://board.phpbuilder.com/showthread.php?10389621-After-Log-in-Pull-Course-Information-Help!-Please&amp;goto=newpost</link>
			<pubDate>Sun, 05 May 2013 00:02:20 GMT</pubDate>
			<description><![CDATA[how do I fix this error? 

*mysql_num_rows() expects parameter 1 to be resource*, null given in /home/content/19/10458419/html/capstone/loginScript/indexTest.php on line 61

My Code

    <?php
}
elseif(!empty($_POST['username']) && !empty($_POST['password']))
{
	 $username = mysql_real_escape_string($_POST['username']);
    $password = md5(mysql_real_escape_string($_POST['password']));
    
	 $checklogin = mysql_query("SELECT * FROM schedule WHERE Username = '".$username."' AND Password = '".$password."'");
    
   if (mysql_num_rows($checkusername) > 0)
    {
    	 $row = mysql_fetch_array($checklogin);
		 
        $email = $row['EmailAddress'];
		 $courseNo = $row['courseNo'];
		  $deptId = $row['deptId'];
		   $callNo = $row['callNo'];
		    $sectDays = $row['sectDays'];
			 $sectStartTime = $row['sectStartTime'];
			  $sectEndTime = $row['sectEndTime'];
			   $roomNo = $row['roomNo'];
			    $bldgId = $row['bldgId'];
        

        $_SESSION['LoggedIn'] = 1;
        
    	 echo "<h1>Success</h1>";
        echo "<p>We are now redirecting you to the member area.</p>";
        echo "<meta http-equiv='refresh' content='=2;indexTest.php' />";
    }
    else
    {
    	 echo "<h1>Error</h1>";
        echo "<p>Sorry, your account could not be found. Please <a href=\"indexTest.php\">click here to try again</a>.</p>";
    }
}
else
{
	?>

:confused::confused::confused:]]></description>
			<content:encoded><![CDATA[<div>how do I fix this error? <br />
<br />
<b>mysql_num_rows() expects parameter 1 to be resource</b>, null given in /home/content/19/10458419/html/capstone/loginScript/indexTest.php on line 61<br />
<br />
My Code<br />
<br />
    &lt;?php<br />
}<br />
elseif(!empty($_POST['username']) &amp;&amp; !empty($_POST['password']))<br />
{<br />
	 $username = mysql_real_escape_string($_POST['username']);<br />
    $password = md5(mysql_real_escape_string($_POST['password']));<br />
    <br />
	 $checklogin = mysql_query(&quot;SELECT * FROM schedule WHERE Username = '&quot;.$username.&quot;' AND Password = '&quot;.$password.&quot;'&quot;);<br />
    <br />
   if (mysql_num_rows($checkusername) &gt; 0)<br />
    {<br />
    	 $row = mysql_fetch_array($checklogin);<br />
		 <br />
        $email = $row['EmailAddress'];<br />
		 $courseNo = $row['courseNo'];<br />
		  $deptId = $row['deptId'];<br />
		   $callNo = $row['callNo'];<br />
		    $sectDays = $row['sectDays'];<br />
			 $sectStartTime = $row['sectStartTime'];<br />
			  $sectEndTime = $row['sectEndTime'];<br />
			   $roomNo = $row['roomNo'];<br />
			    $bldgId = $row['bldgId'];<br />
        <br />
<br />
        $_SESSION['LoggedIn'] = 1;<br />
        <br />
    	 echo &quot;&lt;h1&gt;Success&lt;/h1&gt;&quot;;<br />
        echo &quot;&lt;p&gt;We are now redirecting you to the member area.&lt;/p&gt;&quot;;<br />
        echo &quot;&lt;meta http-equiv='refresh' content='=2;indexTest.php' /&gt;&quot;;<br />
    }<br />
    else<br />
    {<br />
    	 echo &quot;&lt;h1&gt;Error&lt;/h1&gt;&quot;;<br />
        echo &quot;&lt;p&gt;Sorry, your account could not be found. Please &lt;a href=\&quot;indexTest.php\&quot;&gt;click here to try again&lt;/a&gt;.&lt;/p&gt;&quot;;<br />
    }<br />
}<br />
else<br />
{<br />
	?&gt;<br />
<br />
:confused::confused::confused:</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>Abicus</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389621-After-Log-in-Pull-Course-Information-Help!-Please</guid>
		</item>
		<item>
			<title>explain a query - please help</title>
			<link>http://board.phpbuilder.com/showthread.php?10389613-explain-a-query-please-help&amp;goto=newpost</link>
			<pubDate>Sat, 04 May 2013 03:19:46 GMT</pubDate>
			<description><![CDATA[I am not as familiar with the EXPLAIN feature as I should be, can anyone help me with this slow query? Sorry if the table is a bit scattered:



here is my query:

EXPLAIN SELECT m . * /* number of leases that show present COUNT(DISTINCT l.ID) AS Leases,*/
FROM _v_properties_master_list m
LEFT JOIN gl_leases l ON m.ID = l.Units_ID
AND /* the unit/house/etc is leased AS OF THE INTENDED MOVE-IN DAY OF THE SEARCH - we filter this out outside of the left join .. */ '2013-05-03'
BETWEEN l.LeaseStartDate
AND IF( l.LeaseTerminationDate, l.LeaseTerminationDate, IF( l.LeaseEndDate, l.LeaseEndDate, '2199-12-31' ) )
WHERE m.Active =1
AND
TYPE IN (
'APT'
)
AND Bedrooms =1
AND Bathrooms =1
AND PropertyCity
IN (
'San Marcos'
)
AND (
1
)
AND m.ID
IN ( 105, 848 )
GROUP BY m.ID
ORDER BY PropertyName ASC 


and here is the result:

id 	select_type 	table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
1 	PRIMARY 	<derived2> 	ALL 	NULL	NULL	NULL	NULL	777 	Using where; Using temporary; Using filesort
1 	PRIMARY 	l 	ref 	LeaseStartDate,Units_ID 	Units_ID 	4 	m.ID 	20 	
2 	DERIVED 	cl 	ALL 	PRIMARY 	NULL	NULL	NULL	423 	Using temporary; Using filesort
2 	DERIVED 	p 	ref 	Clients_ID 	Clients_ID 	4 	cpm151_sanmarcos.cl.ID 	1 	Using where
2 	DERIVED 	u 	ref 	Clients_ID 	Clients_ID 	4 	cpm151_sanmarcos.p.ID 	2 	
2 	DERIVED 	a 	ref 	LeaseStartDate,Units_ID 	Units_ID 	4 	cpm151_sanmarcos.u.ID 	20 	
2 	DERIVED 	flprimary 	ref 	Type,Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 	
2 	DERIVED 	flc 	eq_ref 	PRIMARY 	PRIMARY 	4 	cpm151_sanmarcos.flprimary.Contacts_ID 	1 	
2 	DERIVED 	flall 	ref 	Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 	
2 	DERIVED 	a 	ref 	LeaseStartDate,Units_ID 	Units_ID 	4 	cpm151_sanmarcos.u.ID 	20 	
2 	DERIVED 	clprimary 	ref 	Type,Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 	
2 	DERIVED 	clc 	eq_ref 	PRIMARY 	PRIMARY 	4 	cpm151_sanmarcos.clprimary.Contacts_ID 	1 	
2 	DERIVED 	clall 	ref 	Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 

now, _v_properties_master_list is a fairly complex and I will post that separately if needed.  Thanks!]]></description>
			<content:encoded><![CDATA[<div>I am not as familiar with the EXPLAIN feature as I should be, can anyone help me with this slow query? Sorry if the table is a bit scattered:<br />
<br />
<br />
<br />
here is my query:<br />
<br />
EXPLAIN SELECT m . * /* number of leases that show present COUNT(DISTINCT l.ID) AS Leases,*/<br />
FROM _v_properties_master_list m<br />
LEFT JOIN gl_leases l ON m.ID = l.Units_ID<br />
AND /* the unit/house/etc is leased AS OF THE INTENDED MOVE-IN DAY OF THE SEARCH - we filter this out outside of the left join .. */ '2013-05-03'<br />
BETWEEN l.LeaseStartDate<br />
AND IF( l.LeaseTerminationDate, l.LeaseTerminationDate, IF( l.LeaseEndDate, l.LeaseEndDate, '2199-12-31' ) )<br />
WHERE m.Active =1<br />
AND<br />
TYPE IN (<br />
'APT'<br />
)<br />
AND Bedrooms =1<br />
AND Bathrooms =1<br />
AND PropertyCity<br />
IN (<br />
'San Marcos'<br />
)<br />
AND (<br />
1<br />
)<br />
AND m.ID<br />
IN ( 105, 848 )<br />
GROUP BY m.ID<br />
ORDER BY PropertyName ASC <br />
<br />
<br />
and here is the result:<br />
<br />
id 	select_type 	table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra<br />
1 	PRIMARY 	&lt;derived2&gt; 	ALL 	NULL	NULL	NULL	NULL	777 	Using where; Using temporary; Using filesort<br />
1 	PRIMARY 	l 	ref 	LeaseStartDate,Units_ID 	Units_ID 	4 	m.ID 	20 	<br />
2 	DERIVED 	cl 	ALL 	PRIMARY 	NULL	NULL	NULL	423 	Using temporary; Using filesort<br />
2 	DERIVED 	p 	ref 	Clients_ID 	Clients_ID 	4 	cpm151_sanmarcos.cl.ID 	1 	Using where<br />
2 	DERIVED 	u 	ref 	Clients_ID 	Clients_ID 	4 	cpm151_sanmarcos.p.ID 	2 	<br />
2 	DERIVED 	a 	ref 	LeaseStartDate,Units_ID 	Units_ID 	4 	cpm151_sanmarcos.u.ID 	20 	<br />
2 	DERIVED 	flprimary 	ref 	Type,Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 	<br />
2 	DERIVED 	flc 	eq_ref 	PRIMARY 	PRIMARY 	4 	cpm151_sanmarcos.flprimary.Contacts_ID 	1 	<br />
2 	DERIVED 	flall 	ref 	Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 	<br />
2 	DERIVED 	a 	ref 	LeaseStartDate,Units_ID 	Units_ID 	4 	cpm151_sanmarcos.u.ID 	20 	<br />
2 	DERIVED 	clprimary 	ref 	Type,Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 	<br />
2 	DERIVED 	clc 	eq_ref 	PRIMARY 	PRIMARY 	4 	cpm151_sanmarcos.clprimary.Contacts_ID 	1 	<br />
2 	DERIVED 	clall 	ref 	Leases_ID 	Leases_ID 	4 	cpm151_sanmarcos.a.ID 	1 <br />
<br />
now, _v_properties_master_list is a fairly complex and I will post that separately if needed.  Thanks!</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>sfullman</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389613-explain-a-query-please-help</guid>
		</item>
		<item>
			<title>execute () on a non-object</title>
			<link>http://board.phpbuilder.com/showthread.php?10389593-execute-()-on-a-non-object&amp;goto=newpost</link>
			<pubDate>Thu, 02 May 2013 15:09:58 GMT</pubDate>
			<description><![CDATA[:glare: I am getting this error on every one of my scripts:


Code:
---------
Fatal error: Call to a member function execute() on a non-object in /Library/WebServer/Documents/DispatchReports/InTime.php on line 55
---------
The offending code is:

PHP:
---------
$host="localhost";
$user="root";
$password="g1G3m#1989";
$Dbname = "CallsToDispatch";

$mysqli = new mysqli($host, $user, $password, $Dbname) or die('host doesnt work ' . $mysqli->error);

// Check connection
if ($mysqli->connect_errno) {
    echo "Hey you dolt, Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}

///////no good


$Quest = "SELECT WorkDate FROM InTime";

    $stmt = $mysqli->prepare($Quest);

$stmt->execute(); // <- error happens here
$DateResult = $stmt->get_result();
		
$TestWorkDate = $row['WorkDate'];
echo $TestWorkDate . ' a ' . $WorkDate . '<br>';
	
ini_set('auto_detect_line_endings', true);
---------
Everything was good at 5:00 yesterday.  Why now?]]></description>
			<content:encoded><![CDATA[<div>:glare: I am getting this error on every one of my scripts:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Fatal error: Call to a member function execute() on a non-object in /Library/WebServer/Documents/DispatchReports/InTime.php on line 55</code><hr />
</div> The offending code is:<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">$host</span><span style="color: #007700">=</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$user</span><span style="color: #007700">=</span><span style="color: #DD0000">"root"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$password</span><span style="color: #007700">=</span><span style="color: #DD0000">"g1G3m#1989"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$Dbname&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"CallsToDispatch"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$mysqli&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">mysqli</span><span style="color: #007700">(</span><span style="color: #0000BB">$host</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$password</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$Dbname</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #DD0000">'host&nbsp;doesnt&nbsp;work&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Check&nbsp;connection<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect_errno</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Hey&nbsp;you&nbsp;dolt,&nbsp;Failed&nbsp;to&nbsp;connect&nbsp;to&nbsp;MySQL:&nbsp;("&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect_errno&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">")&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect_error</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #FF8000">///////no&nbsp;good<br /><br /><br /></span><span style="color: #0000BB">$Quest&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;WorkDate&nbsp;FROM&nbsp;InTime"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$Quest</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();&nbsp;</span><span style="color: #FF8000">//&nbsp;&lt;-&nbsp;error&nbsp;happens&nbsp;here<br /></span><span style="color: #0000BB">$DateResult&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_result</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$TestWorkDate&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'WorkDate'</span><span style="color: #007700">&#93;;<br />echo&nbsp;</span><span style="color: #0000BB">$TestWorkDate&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'&nbsp;a&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$WorkDate&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'&lt;br&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'auto_detect_line_endings'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> Everything was good at 5:00 yesterday.  Why now?</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>timstring</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389593-execute-()-on-a-non-object</guid>
		</item>
		<item>
			<title>Jquery AJAX response from PHP has  brackets around the JSON object</title>
			<link>http://board.phpbuilder.com/showthread.php?10389589-Jquery-AJAX-response-from-PHP-has-brackets-around-the-JSON-object&amp;goto=newpost</link>
			<pubDate>Thu, 02 May 2013 01:56:26 GMT</pubDate>
			<description><![CDATA[Here is my function:

PHP:
---------
function get_it(){
global $mysqli;	
if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '
            . $mysqli->connect_error);
}


$sql = 'SELECT todo,date,name,id FROM task WHERE todo IS NOT NULL || todo > "" ' ;
$sqlOrder = 'Order by Date' ;
$sql .= $sqlOrder ;

$result = $mysqli->query($sql);

if($result = $mysqli->query($sql)) {
	
$i= 0;
	while($row = $result->fetch_object()) {
    
 $function_result[$i]= 	$row;
$i++; 
}	//end while
header('Content-type: application/json');
echo json_encode($function_result);

}//end if

}//end function
---------
The problem is when I don't send the header the JSON encoded string has an extra bracket around it. The header is supposed to tell Jquery that it should be expecting a JSON encoded object but sending the header doesn't get rid of the bracket.  This is the header that is returned in the browser from the PHP script.
http://localhost:8888/todo/todo1.html

GET /todo/todo1.html HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
If-Modified-Since: Thu, 02 May 2013 01:47:33 GMT
If-None-Match: "c4a50a1-1915-4dbb26b051740"
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Thu, 02 May 2013 01:54:00 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Etag: "c4a50a1-1915-4dbb26b051740"
----------------------------------------------------------
http://localhost:8888/todo/todo1.css

GET /todo/todo1.css HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/css,*/*;q=0.1
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost:8888/todo/todo1.html
Connection: keep-alive
If-Modified-Since: Tue, 19 Mar 2013 21:15:41 GMT
If-None-Match: "c4d742b-1a5d-4d84d9b929940"
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Thu, 02 May 2013 01:54:00 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10
Connection: Keep-Alive
Keep-Alive: timeout=5, max=99
Etag: "c4d742b-1a5d-4d84d9b929940"
----------------------------------------------------------
http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

GET /ajax/libs/jquery/1.9.1/jquery.min.js HTTP/1.1
Host: ajax.googleapis.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost:8888/todo/todo1.html
Connection: keep-alive
If-Modified-Since: Fri, 08 Feb 2013 15:35:10 GMT
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Wed, 01 May 2013 13:54:44 GMT
Expires: Thu, 01 May 2014 13:54:44 GMT
Age: 43156
Server: GFE/2.0
----------------------------------------------------------
http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js

GET /ajax/libs/jqueryui/1.10.1/jquery-ui.min.js HTTP/1.1
Host: ajax.googleapis.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost:8888/todo/todo1.html
Connection: keep-alive
If-Modified-Since: Fri, 15 Feb 2013 22:11:00 GMT
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Wed, 01 May 2013 13:55:41 GMT
Expires: Thu, 01 May 2014 13:55:41 GMT
Age: 43099
Server: GFE/2.0
----------------------------------------------------------
http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/overcast/jquery-ui.css

GET /ajax/libs/jqueryui/1.10.0/themes/overcast/jquery-ui.css HTTP/1.1
Host: ajax.googleapis.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/css,*/*;q=0.1
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost:8888/todo/todo1.html
Connection: keep-alive
If-Modified-Since: Thu, 24 Jan 2013 18:41:38 GMT
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Wed, 01 May 2013 21:38:06 GMT
Expires: Thu, 01 May 2014 21:38:06 GMT
Age: 15354
Server: GFE/2.0
----------------------------------------------------------
http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js

GET /ajax/modernizr/modernizr-2.0.6-development-only.js HTTP/1.1
Host: ajax.aspnetcdn.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://localhost:8888/todo/todo1.html
Connection: keep-alive
If-Modified-Since: Mon, 20 Jun 2011 21:39:37 GMT
If-None-Match: "8e7a8f8d922fcc1:0"
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Content-Type: application/x-javascript
Age: 8324272
Date: Thu, 02 May 2013 01:54:00 GMT
Expires: Sat, 25 Jan 2014 17:36:08 GMT
Connection: keep-alive
----------------------------------------------------------
http://localhost:8888/todo/form_handler1.php

GET /todo/form_handler1.php HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Referer: http://localhost:8888/todo/todo1.html
Connection: keep-alive
Cache-Control: max-age=0

HTTP/1.1 200 OK
Date: Thu, 02 May 2013 01:54:01 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10
X-Powered-By: PHP/5.4.10
Content-Length: 2788
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: application/json
----------------------------------------------------------
http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/overcast/images/ui-bg_glass_60_eeeeee_1x400.png

GET /ajax/libs/jqueryui/1.10.0/themes/overcast/images/ui-bg_glass_60_eeeeee_1x400.png HTTP/1.1
Host: ajax.googleapis.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/overcast/jquery-ui.css
Connection: keep-alive
If-Modified-Since: Thu, 24 Jan 2013 18:41:38 GMT
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Content-Type: image/png
Date: Thu, 02 May 2013 01:54:01 GMT
Expires: Fri, 02 May 2014 01:54:01 GMT
Cache-Control: public, max-age=31536000
x-content-type-options: nosniff
Server: sffe
x-xss-protection: 1; mode=block
----------------------------------------------------------

Do you know how to modify MAMP setting so I can get JSON encoded data?
I also tried JSON.stringify(data); to get rid of the brackets and that didn't work.
Thanks,]]></description>
			<content:encoded><![CDATA[<div>Here is my function:<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">get_it</span><span style="color: #007700">(){<br />global&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;<br />if&nbsp;(</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect_error</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #DD0000">'Connect&nbsp;Error&nbsp;('&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect_errno&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">')&nbsp;'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect_error</span><span style="color: #007700">);<br />}<br /><br /><br /></span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'SELECT&nbsp;todo,date,name,id&nbsp;FROM&nbsp;task&nbsp;WHERE&nbsp;todo&nbsp;IS&nbsp;NOT&nbsp;NULL&nbsp;||&nbsp;todo&nbsp;&gt;&nbsp;""&nbsp;'&nbsp;</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sqlOrder&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'Order&nbsp;by&nbsp;Date'&nbsp;</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sql&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #0000BB">$sqlOrder&nbsp;</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">);<br /><br />if(</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query</span><span style="color: #007700">(</span><span style="color: #0000BB">$sql</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$i</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;while(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch_object</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;</span><span style="color: #0000BB">$function_result</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">$i</span><span style="color: #007700">&#93;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$i</span><span style="color: #007700">++;&nbsp;<br />}&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//end&nbsp;while<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;application/json'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">json_encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$function_result</span><span style="color: #007700">);<br /><br />}</span><span style="color: #FF8000">//end&nbsp;if<br /><br /></span><span style="color: #007700">}</span><span style="color: #FF8000">//end&nbsp;function&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> The problem is when I don't send the header the JSON encoded string has an extra bracket around it. The header is supposed to tell Jquery that it should be expecting a JSON encoded object but sending the header doesn't get rid of the bracket.  This is the header that is returned in the browser from the PHP script.<br />
<a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
<br />
GET /todo/todo1.html HTTP/1.1<br />
Host: localhost:8888<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Connection: keep-alive<br />
If-Modified-Since: Thu, 02 May 2013 01:47:33 GMT<br />
If-None-Match: &quot;c4a50a1-1915-4dbb26b051740&quot;<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Date: Thu, 02 May 2013 01:54:00 GMT<br />
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10<br />
Connection: Keep-Alive<br />
Keep-Alive: timeout=5, max=100<br />
Etag: &quot;c4a50a1-1915-4dbb26b051740&quot;<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://localhost:8888/todo/todo1.css" target="_blank">http://localhost:8888/todo/todo1.css</a><br />
<br />
GET /todo/todo1.css HTTP/1.1<br />
Host: localhost:8888<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: text/css,*/*;q=0.1<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Referer: <a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
Connection: keep-alive<br />
If-Modified-Since: Tue, 19 Mar 2013 21:15:41 GMT<br />
If-None-Match: &quot;c4d742b-1a5d-4d84d9b929940&quot;<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Date: Thu, 02 May 2013 01:54:00 GMT<br />
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10<br />
Connection: Keep-Alive<br />
Keep-Alive: timeout=5, max=99<br />
Etag: &quot;c4d742b-1a5d-4d84d9b929940&quot;<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" target="_blank">http://ajax.googleapis.com/ajax/libs.../jquery.min.js</a><br />
<br />
GET /ajax/libs/jquery/1.9.1/jquery.min.js HTTP/1.1<br />
Host: ajax.googleapis.com<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: */*<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Referer: <a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
Connection: keep-alive<br />
If-Modified-Since: Fri, 08 Feb 2013 15:35:10 GMT<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Date: Wed, 01 May 2013 13:54:44 GMT<br />
Expires: Thu, 01 May 2014 13:54:44 GMT<br />
Age: 43156<br />
Server: GFE/2.0<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" target="_blank">http://ajax.googleapis.com/ajax/libs...uery-ui.min.js</a><br />
<br />
GET /ajax/libs/jqueryui/1.10.1/jquery-ui.min.js HTTP/1.1<br />
Host: ajax.googleapis.com<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: */*<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Referer: <a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
Connection: keep-alive<br />
If-Modified-Since: Fri, 15 Feb 2013 22:11:00 GMT<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Date: Wed, 01 May 2013 13:55:41 GMT<br />
Expires: Thu, 01 May 2014 13:55:41 GMT<br />
Age: 43099<br />
Server: GFE/2.0<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/overcast/jquery-ui.css" target="_blank">http://ajax.googleapis.com/ajax/libs.../jquery-ui.css</a><br />
<br />
GET /ajax/libs/jqueryui/1.10.0/themes/overcast/jquery-ui.css HTTP/1.1<br />
Host: ajax.googleapis.com<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: text/css,*/*;q=0.1<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Referer: <a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
Connection: keep-alive<br />
If-Modified-Since: Thu, 24 Jan 2013 18:41:38 GMT<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Date: Wed, 01 May 2013 21:38:06 GMT<br />
Expires: Thu, 01 May 2014 21:38:06 GMT<br />
Age: 15354<br />
Server: GFE/2.0<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js" target="_blank">http://ajax.aspnetcdn.com/ajax/moder...opment-only.js</a><br />
<br />
GET /ajax/modernizr/modernizr-2.0.6-development-only.js HTTP/1.1<br />
Host: ajax.aspnetcdn.com<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: */*<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Referer: <a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
Connection: keep-alive<br />
If-Modified-Since: Mon, 20 Jun 2011 21:39:37 GMT<br />
If-None-Match: &quot;8e7a8f8d922fcc1:0&quot;<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Content-Type: application/x-javascript<br />
Age: 8324272<br />
Date: Thu, 02 May 2013 01:54:00 GMT<br />
Expires: Sat, 25 Jan 2014 17:36:08 GMT<br />
Connection: keep-alive<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://localhost:8888/todo/form_handler1.php" target="_blank">http://localhost:8888/todo/form_handler1.php</a><br />
<br />
GET /todo/form_handler1.php HTTP/1.1<br />
Host: localhost:8888<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: application/json, text/javascript, */*; q=0.01<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
X-Requested-With: XMLHttpRequest<br />
Referer: <a rel="nofollow" href="http://localhost:8888/todo/todo1.html" target="_blank">http://localhost:8888/todo/todo1.html</a><br />
Connection: keep-alive<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 200 OK<br />
Date: Thu, 02 May 2013 01:54:01 GMT<br />
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10<br />
X-Powered-By: PHP/5.4.10<br />
Content-Length: 2788<br />
Keep-Alive: timeout=5, max=98<br />
Connection: Keep-Alive<br />
Content-Type: application/json<br />
----------------------------------------------------------<br />
<a rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/overcast/images/ui-bg_glass_60_eeeeee_1x400.png" target="_blank">http://ajax.googleapis.com/ajax/libs...eeee_1x400.png</a><br />
<br />
GET /ajax/libs/jqueryui/1.10.0/themes/overcast/images/ui-bg_glass_60_eeeeee_1x400.png HTTP/1.1<br />
Host: ajax.googleapis.com<br />
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0<br />
Accept: image/png,image/*;q=0.8,*/*;q=0.5<br />
Accept-Language: en-US,en;q=0.5<br />
Accept-Encoding: gzip, deflate<br />
Referer: <a rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/overcast/jquery-ui.css" target="_blank">http://ajax.googleapis.com/ajax/libs.../jquery-ui.css</a><br />
Connection: keep-alive<br />
If-Modified-Since: Thu, 24 Jan 2013 18:41:38 GMT<br />
Cache-Control: max-age=0<br />
<br />
HTTP/1.1 304 Not Modified<br />
Content-Type: image/png<br />
Date: Thu, 02 May 2013 01:54:01 GMT<br />
Expires: Fri, 02 May 2014 01:54:01 GMT<br />
Cache-Control: public, max-age=31536000<br />
x-content-type-options: nosniff<br />
Server: sffe<br />
x-xss-protection: 1; mode=block<br />
----------------------------------------------------------<br />
<br />
Do you know how to modify MAMP setting so I can get JSON encoded data?<br />
I also tried JSON.stringify(data); to get rid of the brackets and that didn't work.<br />
Thanks,</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>jrough</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389589-Jquery-AJAX-response-from-PHP-has-brackets-around-the-JSON-object</guid>
		</item>
		<item>
			<title>issue selecting records using LEFT OUTER JOIN. results not ignoring blank records</title>
			<link>http://board.phpbuilder.com/showthread.php?10389561-issue-selecting-records-using-LEFT-OUTER-JOIN.-results-not-ignoring-blank-records&amp;goto=newpost</link>
			<pubDate>Mon, 29 Apr 2013 23:39:50 GMT</pubDate>
			<description><![CDATA[Hello everybody,

Problem with the following statement, uniquemerchantid in some instance is blank but as you can see from the output i copy/pasted at the bottom its repeating the results due to empty fields.

Any help you can give me would be greatly appreciated.

$stmt = $this->dbcon1 ->query("SELECT
tbl_merchant.merchantname,
tbl_questions.projectid,
tbl_questions.merchantid,
tbl_questions.question,
tbl_questions.date
FROM tbl_questions
LEFT OUTER
JOIN tbl_merchant
ON tbl_merchant.uniquemerchantid = tbl_questions.merchantid
WHERE tbl_questions.projectid = '$this->projectId' ");

----------------------------
part of the output
Array
(
[0] => Array
(
[merchantname] => Cakewalk
[projectid] => 096675edc895d5d03667e15c47d94e6651559e5e8ec36
[merchantid] => 666ee17c24f8c73d25be1dbf2e85ea6951537ab7da5f4
[question] => 1-0How big is your kitchen?
[date] => 2013-04-26 11:14:00
)

[1] => Array
(
[merchantname] => Borland
[projectid] => 096675edc895d5d03667e15c47d94e6651559e5e8ec36
[merchantid] => ecb6bfe5ae52b191689adc1e41cd875c51733f8108552
[question] => 2-1 are there tiles installed in your kitchen and when where they installed?
[date] => 2013-04-26 11:14:22
)

[2] => Array
(
[merchantname] => Borland
[projectid] => 096675edc895d5d03667e15c47d94e6651559e5e8ec36
[merchantid] => ecb6bfe5ae52b191689adc1e41cd875c51733f8108552
[question] => 3-2 more test questions and answerthere tiles installed in your kitchen and when where they installed?
[date] => 2013-04-26 11:14:41
)

[3] => Array
(
[merchantname] => Microsoft
[projectid] => 096675edc895d5d03667e15c47d94e6651559e5e8ec36
[merchantid] =>
[question] => 4-3 replay from the person posted the project 1
[date] => 2013-04-28 16:24:25
)

[4] => Array
(
[merchantname] => Adobe
[projectid] => 096675edc895d5d03667e15c47d94e6651559e5e8ec36
[merchantid] =>
[question] => 4-3 replay from the person posted the project 1
[date] => 2013-04-28 16:24:25
)

[5] => Array
(
[merchantname] =>
[projectid] => 096675edc895d5d03667e15c47d94e6651559e5e8ec36
[merchantid] =>
[question] => 4-3 replay from the person posted the project 1
[date] => 2013-04-28 16:24:25
)]]></description>
			<content:encoded><![CDATA[<div>Hello everybody,<br />
<br />
Problem with the following statement, uniquemerchantid in some instance is blank but as you can see from the output i copy/pasted at the bottom its repeating the results due to empty fields.<br />
<br />
Any help you can give me would be greatly appreciated.<br />
<br />
$stmt = $this-&gt;dbcon1 -&gt;query(&quot;SELECT<br />
tbl_merchant.merchantname,<br />
tbl_questions.projectid,<br />
tbl_questions.merchantid,<br />
tbl_questions.question,<br />
tbl_questions.date<br />
FROM tbl_questions<br />
LEFT OUTER<br />
JOIN tbl_merchant<br />
ON tbl_merchant.uniquemerchantid = tbl_questions.merchantid<br />
WHERE tbl_questions.projectid = '$this-&gt;projectId' &quot;);<br />
<br />
----------------------------<br />
part of the output<br />
Array<br />
(<br />
[0] =&gt; Array<br />
(<br />
[merchantname] =&gt; Cakewalk<br />
[projectid] =&gt; 096675edc895d5d03667e15c47d94e6651559e5e8ec36<br />
[merchantid] =&gt; 666ee17c24f8c73d25be1dbf2e85ea6951537ab7da5f4<br />
[question] =&gt; 1-0How big is your kitchen?<br />
[date] =&gt; 2013-04-26 11:14:00<br />
)<br />
<br />
[1] =&gt; Array<br />
(<br />
[merchantname] =&gt; Borland<br />
[projectid] =&gt; 096675edc895d5d03667e15c47d94e6651559e5e8ec36<br />
[merchantid] =&gt; ecb6bfe5ae52b191689adc1e41cd875c51733f8108552<br />
[question] =&gt; 2-1 are there tiles installed in your kitchen and when where they installed?<br />
[date] =&gt; 2013-04-26 11:14:22<br />
)<br />
<br />
[2] =&gt; Array<br />
(<br />
[merchantname] =&gt; Borland<br />
[projectid] =&gt; 096675edc895d5d03667e15c47d94e6651559e5e8ec36<br />
[merchantid] =&gt; ecb6bfe5ae52b191689adc1e41cd875c51733f8108552<br />
[question] =&gt; 3-2 more test questions and answerthere tiles installed in your kitchen and when where they installed?<br />
[date] =&gt; 2013-04-26 11:14:41<br />
)<br />
<br />
[3] =&gt; Array<br />
(<br />
[merchantname] =&gt; Microsoft<br />
[projectid] =&gt; 096675edc895d5d03667e15c47d94e6651559e5e8ec36<br />
[merchantid] =&gt;<br />
[question] =&gt; 4-3 replay from the person posted the project 1<br />
[date] =&gt; 2013-04-28 16:24:25<br />
)<br />
<br />
[4] =&gt; Array<br />
(<br />
[merchantname] =&gt; Adobe<br />
[projectid] =&gt; 096675edc895d5d03667e15c47d94e6651559e5e8ec36<br />
[merchantid] =&gt;<br />
[question] =&gt; 4-3 replay from the person posted the project 1<br />
[date] =&gt; 2013-04-28 16:24:25<br />
)<br />
<br />
[5] =&gt; Array<br />
(<br />
[merchantname] =&gt;<br />
[projectid] =&gt; 096675edc895d5d03667e15c47d94e6651559e5e8ec36<br />
[merchantid] =&gt;<br />
[question] =&gt; 4-3 replay from the person posted the project 1<br />
[date] =&gt; 2013-04-28 16:24:25<br />
)</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>robinson</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389561-issue-selecting-records-using-LEFT-OUTER-JOIN.-results-not-ignoring-blank-records</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] Two tables and two queries but I have an issue]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389507-RESOLVED-Two-tables-and-two-queries-but-I-have-an-issue&amp;goto=newpost</link>
			<pubDate>Wed, 24 Apr 2013 16:00:26 GMT</pubDate>
			<description><![CDATA[Hi All

It would be great if someone can help.

I am building a very simple booking system for a group of small hotels. I have three tables one called hotel, one called rooms and one called bookings. Each hotel has an id called hid and each room in every hotel has the individual hotel id and individual room id called rid. When someone makes a booking it goes into the bookings table. When selected the idea is to show how many rooms are available in each hotel by means of filling out a quick form with $d $m $y and the end date of the vacation being $d1 $m1 $y1. i am trying to show each hotel and number of rooms available in the at hotel. I hope that makes sense.

So the list should look like Devon Hotel 3 rooms available Cary Hotel 2 rooms available.

When I break the code down each bit works but when I put it together the problem I have is it shows all the hotels but returns the words 0 rows. This is because the second query cant take the id hid from the first query. Here is the code


PHP:
---------
include 'config.php';
include 'date.class.php';
$start = new Date(false ,$d, $m, $y);
$end = new Date(false ,$d1, $m1, $y1);
$query = "SELECT * FROM `hotel`ORDER BY RAND()";		
$result = mysql_query ($query); // Run the query.
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
 {
	echo '
	    <h2>' . $row['name'] . '</h2>
	';
}
;
$result = mysql_query ("SELECT * FROM rooms WHERE (hid = '$hid') AND rid NOT IN (SELECT rid FROM bookings WHERE (hid = '$hid') AND ((startdate >= ".$start->getTime()." OR enddate > ".$start->getTime().") AND (startdate < ".$end->getTime().")))");
$num_rows = mysql_num_rows($result);

echo "$num_rows Rows";

mysql_free_result ($result); // Free up the resources.	

mysql_close();
---------
If anyone has any ideas on how to make it work with the hotel name and available rooms showing underneath I would be very pleased.

Thank you for looking

Have a great day and an even better one if you can help]]></description>
			<content:encoded><![CDATA[<div>Hi All<br />
<br />
It would be great if someone can help.<br />
<br />
I am building a very simple booking system for a group of small hotels. I have three tables one called hotel, one called rooms and one called bookings. Each hotel has an id called hid and each room in every hotel has the individual hotel id and individual room id called rid. When someone makes a booking it goes into the bookings table. When selected the idea is to show how many rooms are available in each hotel by means of filling out a quick form with $d $m $y and the end date of the vacation being $d1 $m1 $y1. i am trying to show each hotel and number of rooms available in the at hotel. I hope that makes sense.<br />
<br />
So the list should look like Devon Hotel 3 rooms available Cary Hotel 2 rooms available.<br />
<br />
When I break the code down each bit works but when I put it together the problem I have is it shows all the hotels but returns the words 0 rows. This is because the second query cant take the id hid from the first query. Here is the code<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">include&nbsp;</span><span style="color: #DD0000">'config.php'</span><span style="color: #007700">;<br />include&nbsp;</span><span style="color: #DD0000">'date.class.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$start&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Date</span><span style="color: #007700">(</span><span style="color: #0000BB">false&nbsp;</span><span style="color: #007700">,</span><span style="color: #0000BB">$d</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$m</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$y</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$end&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Date</span><span style="color: #007700">(</span><span style="color: #0000BB">false&nbsp;</span><span style="color: #007700">,</span><span style="color: #0000BB">$d1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$m1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$y1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;`hotel`ORDER&nbsp;BY&nbsp;RAND()"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Run&nbsp;the&nbsp;query.<br /></span><span style="color: #007700">while&nbsp;(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">MYSQL_ASSOC</span><span style="color: #007700">))<br />&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'name'</span><span style="color: #007700">&#93;&nbsp;.&nbsp;</span><span style="color: #DD0000">'&lt;/h2&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;'</span><span style="color: #007700">;<br />}<br />;<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;rooms&nbsp;WHERE&nbsp;(hid&nbsp;=&nbsp;'</span><span style="color: #0000BB">$hid</span><span style="color: #DD0000">')&nbsp;AND&nbsp;rid&nbsp;NOT&nbsp;IN&nbsp;(SELECT&nbsp;rid&nbsp;FROM&nbsp;bookings&nbsp;WHERE&nbsp;(hid&nbsp;=&nbsp;'</span><span style="color: #0000BB">$hid</span><span style="color: #DD0000">')&nbsp;AND&nbsp;((startdate&nbsp;&gt;=&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$start</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">().</span><span style="color: #DD0000">"&nbsp;OR&nbsp;enddate&nbsp;&gt;&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$start</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">().</span><span style="color: #DD0000">")&nbsp;AND&nbsp;(startdate&nbsp;&lt;&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$end</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">().</span><span style="color: #DD0000">")))"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$num_rows&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$num_rows</span><span style="color: #DD0000">&nbsp;Rows"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">mysql_free_result&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Free&nbsp;up&nbsp;the&nbsp;resources.&nbsp;&nbsp;&nbsp;&nbsp;<br /><br /></span><span style="color: #0000BB">mysql_close</span><span style="color: #007700">();&nbsp;<br /></span><span style="color: #0000BB"></span>
</span>
</code></code><hr />
</div> If anyone has any ideas on how to make it work with the hotel name and available rooms showing underneath I would be very pleased.<br />
<br />
Thank you for looking<br />
<br />
Have a great day and an even better one if you can help</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>chrispos</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389507-RESOLVED-Two-tables-and-two-queries-but-I-have-an-issue</guid>
		</item>
		<item>
			<title><![CDATA[echo $_session['first name'] problems]]></title>
			<link>http://board.phpbuilder.com/showthread.php?10389499-echo-_session-first-name-problems&amp;goto=newpost</link>
			<pubDate>Wed, 24 Apr 2013 06:12:35 GMT</pubDate>
			<description><![CDATA[Hi there,

(sorry if posted in wrong topic ive been awake for 18 hours lookin into this problem and others which i have now fixed but this one i cant figure out.)

Basicly i am trying to get: 
PHP:
---------
                <div class="content_header_01">
                <?php 
                echo  "Welcome " ;$_SESSION['first_name'];
                ?>
                </div>
---------
to work, 

<full page here>

HTML:
---------
 
		<?php
			session_start();
			if(!session_is_registered($first_name)){
			header("location:members_area.html");
			}
		?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Kamikazi-Studio</title>
		<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
	</head>
<body>
	<div id="templatemo_container">
		<div id="templatemo_top_panel">  
			<div id="top_panel_ls">
				<div id="templatemo_site_title">Kamikazi-Studio</div>
			</div>

      <div id="top_panel_rs">
            <div id="search_section">
                <form action="#" method="get">
                    <input type="text" name="q" size="10" id="searchfield" title="searchfield" />
                  <input type="submit" name="Search" value="Search" alt="Search" id="searchbutton" title="Search" />
                </form>
            	<div class="cleaner"></div>
            </div> 
            
            <div id="templatemo_menu">
                <ul>                
                    <li><a href="index.html" class="current">Home</a></li>
                    <li></li>
                    <li><a href="#"><span></span>Albums</a></li>
                    <li><a href="register.html"><span></span>Register</a></li>
                    <li></li>
                </ul>   
                <div class="cleaner"></div> 	
            </div> <!-- end of menu -->

            <div class="cleaner"></div>
	  </div>    
    </div> <!-- end of top _panel -->
    
    <div id="templatemo_banner">
    
        <div id="banner_header_01">Members Area</div>
        <div id="banner_header_02">Just for you</div>
        <div id="banner_text">
            <p>Update your personal details, passwords or even just view your comments you have made recently here.<br />
            </p>
            <div class="rc_btn_01"></div>
        </div>
    </div>	<!-- end of banner -->
    
    <div id="ct"></div>
    <div id="templatemo_content">

        <div id="content_left">
            <div class="content_left_280_section margin_right_40">
               <div class="content_header_01">
                  <?php 
                      echo  "Welcome ";$_SESSION['first_name'];
                   ?>
               </div>     
                <p align="justify">Welcome, you have 0 Photos in your gallery<strong> click here </strong>to upload one.</p>
                <p align="justify">&nbsp;</p>
                <p align="justify">When you have uploaded some photos you can have one as your image for your member page. This will also be the album cover which other members will see first. </p>
                <p align="justify">&nbsp;</p>
                <p align="justify">Please remember that nudity or racist images are banned from this site, any use of such images will result in your account bieng banned from this site as well.</p>
                <p align="justify">&nbsp;</p>
                <p align="justify">&nbsp;</p>
                <p align="justify">&nbsp;</p>
                <p align="justify">&nbsp;</p>
                <p align="justify">&nbsp;</p>
                <p align="justify"><br />
                </p>
                <div class="cleaner"></div>
                <div class="rc_btn_01"></div>   
                <div class="cleaner"></div>
            </div>
            <div class="content_left_280_section margin_right_40">
              <div class="content_header_01">Your most recent comments</div>
              <p align="justify">&nbsp;</p>
              <p align="justify">comment</p>
              <p align="justify">&nbsp;</p>
              <hr />
              <p align="justify">&nbsp;</p>
              <p align="justify">comment</p>
              <p align="justify">&nbsp;</p>
              <hr />
              <p align="justify">&nbsp;</p>
              <p align="justify">comment</p>
              <p align="justify">&nbsp;</p>
              <p align="justify">&nbsp;</p>
              <p align="justify">&nbsp;</p>
              <p align="justify">&nbsp;</p>
              <p align="justify">&nbsp;</p>
              <p align="justify">&nbsp;</p>
              <p align="justify"><br />
              </p>
              <div class="cleaner"></div>
              <div class="rc_btn_01"></div>
              <div class="cleaner"></div>
            </div>
        </div>
        <!-- end of content left -->
        
        <div id="content_right"><!-- end of news section -->
            <div class="content_right_section">
              <p>Change your Password<br />
              Request a new Username</p>
              <p>Change your Email Address</p>
              <p><a href="logout.php">Logout</a></p>
              <hr />
              <p>Your Comments (New Feature)</p>
              <p>Your Album              </p>
              <hr />
              <p>Support</p>
              <p>Contact Us</p>
              <p>Rules of this site</p>
              <p>&nbsp;</p>
                <form action="#" method="get">
                </form>
                <div class="cleaner"></div>
            </div>
            
            <div class="margin_bottom_20 border_bottom"></div>
            <div class="margin_bottom_20"></div>
            
            <div class="content_right_section"></div>
        
            <div class="cleaner_h30">&nbsp;</div>
        </div> <!-- end of content right -->        
    	<div class="cleaner"></div>
    
	</div> <!-- end of content -->
	<div id="cb"></div>
    
    <div id="templatemo_footer">
    Copyright © 2013 <a href="#">INSERT COPYRIGHT HERE</a></div> <!-- end of footer -->

</div> <!-- end of container -->
</body>
</html>
---------
and i cant get it to respond however sesion id responds to me when i print_r.

if anyone can have a look into why this might not be taken into account i would greatly appreciate it.

Thank you.]]></description>
			<content:encoded><![CDATA[<div>Hi there,<br />
<br />
(sorry if posted in wrong topic ive been awake for 18 hours lookin into this problem and others which i have now fixed but this one i cant figure out.)<br />
<br />
Basicly i am trying to get: <div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class="content_header_01"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;&nbsp;</span><span style="color: #DD0000">"Welcome&nbsp;"&nbsp;</span><span style="color: #007700">;</span><span style="color: #0000BB">$_SESSION</span><span style="color: #007700">&#91;</span><span style="color: #DD0000">'first_name'</span><span style="color: #007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">?&gt;<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</span>
</code></code><hr />
</div> to work, <br />
<br />
&lt;full page here&gt;<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;?php<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session_start();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!session_is_registered($first_name)){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header(&quot;location:members_area.html&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?&gt;</span><br />
<span style="color:#000080">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><br />
<span style="color:#000080">&lt;html xmlns=<span style="color:#0000FF">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;head&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;meta http-equiv=&quot;Content-Type&quot; content=<span style="color:#0000FF">&quot;text/html; charset=utf-8&quot;</span> /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;title&gt;</span>Kamikazi-Studio<span style="color:#000080">&lt;/title&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;link href=<span style="color:#0000FF">&quot;templatemo_style.css&quot;</span> rel=<span style="color:#0000FF">&quot;stylesheet&quot;</span> type=<span style="color:#0000FF">&quot;text/css&quot;</span> /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/head&gt;</span><br />
<span style="color:#000080">&lt;body&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_container&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_top_panel&quot;</span>&gt;</span>&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;top_panel_ls&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_site_title&quot;</span>&gt;</span>Kamikazi-Studio<span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;top_panel_rs&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;search_section&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;form action=<span style="color:#0000FF">&quot;#&quot;</span> method=<span style="color:#0000FF">&quot;get&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;text&quot;</span> name=<span style="color:#0000FF">&quot;q&quot;</span> size=<span style="color:#0000FF">&quot;10&quot;</span> id=<span style="color:#0000FF">&quot;searchfield&quot;</span> title=<span style="color:#0000FF">&quot;searchfield&quot;</span> /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;submit&quot;</span> name=<span style="color:#0000FF">&quot;Search&quot;</span> value=<span style="color:#0000FF">&quot;Search&quot;</span> alt=<span style="color:#0000FF">&quot;Search&quot;</span> id=<span style="color:#0000FF">&quot;searchbutton&quot;</span> title=<span style="color:#0000FF">&quot;Search&quot;</span> /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;/form&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_menu&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;ul&gt;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;li&gt;</span><span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;index.html&quot;</span> class=<span style="color:#0000FF">&quot;current&quot;</span>&gt;</span>Home<span style="color:#008000">&lt;/a&gt;</span><span style="color:#000080">&lt;/li&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;li&gt;</span><span style="color:#000080">&lt;/li&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;li&gt;</span><span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;#&quot;</span>&gt;</span><span style="color:#000080">&lt;span&gt;</span><span style="color:#000080">&lt;/span&gt;</span>Albums<span style="color:#008000">&lt;/a&gt;</span><span style="color:#000080">&lt;/li&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;li&gt;</span><span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;register.html&quot;</span>&gt;</span><span style="color:#000080">&lt;span&gt;</span><span style="color:#000080">&lt;/span&gt;</span>Register<span style="color:#008000">&lt;/a&gt;</span><span style="color:#000080">&lt;/li&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;li&gt;</span><span style="color:#000080">&lt;/li&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/ul&gt;</span>&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span>&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span> <i><span style="color:#000080">&lt;!-- end of menu --&gt;</span></i><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span>&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span> <i><span style="color:#000080">&lt;!-- end of top _panel --&gt;</span></i><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_banner&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;banner_header_01&quot;</span>&gt;</span>Members Area<span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;banner_header_02&quot;</span>&gt;</span>Just for you<span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;banner_text&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Update your personal details, passwords or even just view your comments you have made recently here.<span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;rc_btn_01&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span>&nbsp; &nbsp; &nbsp; &nbsp; <i><span style="color:#000080">&lt;!-- end of banner --&gt;</span></i><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;ct&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_content&quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;content_left&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;content_left_280_section margin_right_40&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;content_header_01&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;?php <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo&nbsp; &quot;Welcome &quot;;$_SESSION&#91;'first_name'&#93;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <span style="color:#000080">&lt;/div&gt;</span>&nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span>Welcome, you have 0 Photos in your gallery<span style="color:#000080">&lt;strong&gt;</span> click here <span style="color:#000080">&lt;/strong&gt;</span>to upload one.<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span>When you have uploaded some photos you can have one as your image for your member page. This will also be the album cover which other members will see first. <span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span>Please remember that nudity or racist images are banned from this site, any use of such images will result in your account bieng banned from this site as well.<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;rc_btn_01&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span>&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;content_left_280_section margin_right_40&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;content_header_01&quot;</span>&gt;</span>Your most recent comments<span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span>comment<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;hr /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span>comment<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;hr /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span>comment<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p align=<span style="color:#0000FF">&quot;justify&quot;</span>&gt;</span><span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;rc_btn_01&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <i><span style="color:#000080">&lt;!-- end of content left --&gt;</span></i><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;content_right&quot;</span>&gt;</span><i><span style="color:#000080">&lt;!-- end of news section --&gt;</span></i><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;content_right_section&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Change your Password<span style="color:#000080">&lt;br /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Request a new Username<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Change your Email Address<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span><span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;logout.php&quot;</span>&gt;</span>Logout<span style="color:#008000">&lt;/a&gt;</span><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;hr /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Your Comments (New Feature)<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Your Album&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;hr /&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Support<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Contact Us<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span>Rules of this site<span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;p&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/p&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;form action=<span style="color:#0000FF">&quot;#&quot;</span> method=<span style="color:#0000FF">&quot;get&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF8000">&lt;/form&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;margin_bottom_20 border_bottom&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;margin_bottom_20&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;content_right_section&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner_h30&quot;</span>&gt;</span><b><i>&amp;nbsp;</i></b><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span> <i><span style="color:#000080">&lt;!-- end of content right --&gt;</span></i>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div class=<span style="color:#0000FF">&quot;cleaner&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;/div&gt;</span> <i><span style="color:#000080">&lt;!-- end of content --&gt;</span></i><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;cb&quot;</span>&gt;</span><span style="color:#000080">&lt;/div&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#000080">&lt;div id=<span style="color:#0000FF">&quot;templatemo_footer&quot;</span>&gt;</span><br />
&nbsp; &nbsp; Copyright © 2013 <span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;#&quot;</span>&gt;</span>INSERT COPYRIGHT HERE<span style="color:#008000">&lt;/a&gt;</span><span style="color:#000080">&lt;/div&gt;</span> <i><span style="color:#000080">&lt;!-- end of footer --&gt;</span></i><br />
<br />
<span style="color:#000080">&lt;/div&gt;</span> <i><span style="color:#000080">&lt;!-- end of container --&gt;</span></i><br />
<span style="color:#000080">&lt;/body&gt;</span><br />
<span style="color:#000080">&lt;/html&gt;</span></code><hr />
</div> and i cant get it to respond however sesion id responds to me when i print_r.<br />
<br />
if anyone can have a look into why this might not be taken into account i would greatly appreciate it.<br />
<br />
Thank you.</div>

 ]]></content:encoded>
			<category domain="http://board.phpbuilder.com/forumdisplay.php?6-Database">Database</category>
			<dc:creator>deadkamikazi</dc:creator>
			<guid isPermaLink="true">http://board.phpbuilder.com/showthread.php?10389499-echo-_session-first-name-problems</guid>
		</item>
	</channel>
</rss>
