<?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</title>
		<link>http://www.phpbuilder.com/board</link>
		<description>This is a discussion forum for discussing all aspects of the serverside scripting language PHP</description>
		<language>en</language>
		<lastBuildDate>Fri, 18 May 2012 11:23:10 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://board.phpbuilder.com/board/images/misc/rss.jpg</url>
			<title>PHPBuilder.com</title>
			<link>http://www.phpbuilder.com/board</link>
		</image>
		<item>
			<title>Id is not passing when clicking on the link</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384519&amp;goto=newpost</link>
			<pubDate>Fri, 18 May 2012 10:58:10 GMT</pubDate>
			<description><![CDATA[hey need fast help on this matter. In my veiwall.php there are links to click and edit the items. But the problem is id isnot parsing when i click them. This is how it display when i click on edit link.
address bar shows >>> http://localhost/metal/editchemical.php?id=

if i type id infront of = mark it works perfectly. This is my code for veiwall.php page. Hope u guys will help me 


PHP:
---------
<?php
session_start();

if(!isset($_SESSION['SESS_LOGIN']) || $_SESSION['SESS_TYPE'] !='admin')  
{                                                                                 
  echo '<script language="javascript">'; 
  echo  'alert("Please login as ADMINISTRATOR to edit a user");';  
  echo  '</script>';                 

} 
else 

      include("config.php");
	  
	$tableName="chemical";		
	$targetpage = "view_all_chemical.php"; 	
	$limit = 5; 
	
	$query = "SELECT COUNT(*) as num FROM $tableName";
	$total_pages = mysql_fetch_array(mysql_query($query));
	$total_pages = $total_pages[num];
	
	$stages = 3;
	$page = mysql_escape_string($_GET['page']);
	if($page){
		$start = ($page - 1) * $limit; 
	}else{
		$start = 0;	
		}	
	
    // Get page data
	$query1 = "SELECT generalname, Scientificname, quantity, reorder FROM $tableName LIMIT $start, $limit";
	$result = mysql_query($query1);
	
	// Initial page num setup
	if ($page == 0){$page = 1;}
	$prev = $page - 1;	
	$next = $page + 1;							
	$lastpage = ceil($total_pages/$limit);		
	$LastPagem1 = $lastpage - 1;					
	
	
	$paginate = '';
	if($lastpage > 1)
	{	
	

	
	
		$paginate .= "<div class='paginate'>";
		// Previous
		if ($page > 1){
			$paginate.= "<a href='$targetpage?page=$prev'>previous</a>";
		}else{
			$paginate.= "<span class='disabled'>previous</span>";	}
			

		
		// Pages	
		if ($lastpage < 7 + ($stages * 2))	// Not enough pages to breaking it up
		{	
			for ($counter = 1; $counter <= $lastpage; $counter++)
			{
				if ($counter == $page){
					$paginate.= "<span class='current'>$counter</span>";
				}else{
					$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
			}
		}
		elseif($lastpage > 5 + ($stages * 2))	// Enough pages to hide a few?
		{
			// Beginning only hide later pages
			if($page < 1 + ($stages * 2))		
			{
				for ($counter = 1; $counter < 4 + ($stages * 2); $counter++)
				{
					if ($counter == $page){
						$paginate.= "<span class='current'>$counter</span>";
					}else{
						$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
				}
				$paginate.= "...";
				$paginate.= "<a href='$targetpage?page=$LastPagem1'>$LastPagem1</a>";
				$paginate.= "<a href='$targetpage?page=$lastpage'>$lastpage</a>";		
			}
			// Middle hide some front and some back
			elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))
			{
				$paginate.= "<a href='$targetpage?page=1'>1</a>";
				$paginate.= "<a href='$targetpage?page=2'>2</a>";
				$paginate.= "...";
				for ($counter = $page - $stages; $counter <= $page + $stages; $counter++)
				{
					if ($counter == $page){
						$paginate.= "<span class='current'>$counter</span>";
					}else{
						$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
				}
				$paginate.= "...";
				$paginate.= "<a href='$targetpage?page=$LastPagem1'>$LastPagem1</a>";
				$paginate.= "<a href='$targetpage?page=$lastpage'>$lastpage</a>";		
			}
			// End only hide early pages
			else
			{
				$paginate.= "<a href='$targetpage?page=1'>1</a>";
				$paginate.= "<a href='$targetpage?page=2'>2</a>";
				$paginate.= "...";
				for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++)
				{
					if ($counter == $page){
						$paginate.= "<span class='current'>$counter</span>";
					}else{
						$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
				}
			}
		}
					
				// Next
		if ($page < $counter - 1){ 
			$paginate.= "<a href='$targetpage?page=$next'>next</a>";
		}else{
			$paginate.= "<span class='disabled'>next</span>";
			}
			
				
	$paginate.= "</div>";
	
}
 

// get results from database
     //   $result = mysql_query("SELECT * FROM members") 
       //         or die(mysql_error());  
                
        // display data in table          
        echo "<table id='table'>";
        echo "<tr> <th>Name</th> <th>Code</th> <th>Quantity</th> <th>Reorder</th><th>Edit</th><th>Delete</th><th>Stock</th>  </tr>";

        // loop through results of database query, displaying them in the table
        while($row = mysql_fetch_array( $result )) 
		{
                
                // echo out the contents of each row into a table
                echo "<tr>";
                echo '<td>' . $row['generalname'] . '</td>';
                echo '<td>' . $row['Scientificname'] . '</td>';
                echo '<td>' . $row['quantity'] . '</td>';
				echo '<td>'. $row['reorder'] . '</td>';
                echo '<td><a href="editchemical.php?id=' . $row['id'] . '">Edit</a></td>';
				echo '<td><a href="delete_chemical.php?id=' . $row['id'] . '">Delete</a></td>';
				echo '<td><a href="stock_chemical.php?id=' . $row['id'] . '">Stock</a></td>';
                //echo '<td><a href="edituser.php?id=' . $row['id'] . '">Edit</a></td>';
                //echo '<td><a href="delete_user.php?id=' . $row['id'] . '">Delete</a></td>';
                echo "</tr>"; 
					
        } 
       echo "</table>"; 
echo $paginate;
        
	?>
---------

This is the error it shows
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]]></description>
			<content:encoded><![CDATA[<div>hey need fast help on this matter. In my veiwall.php there are links to click and edit the items. But the problem is id isnot parsing when i click them. This is how it display when i click on edit link.<br />
address bar shows &gt;&gt;&gt; <a rel="nofollow" href="http://localhost/metal/editchemical.php?id=" target="_blank">http://localhost/metal/editchemical.php?id=</a><br />
<br />
if i type id infront of = mark it works perfectly. This is my code for veiwall.php page. Hope u guys will help me <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />session_start</font><font color="#007700">();<br /><br />if(!isset(</font><font color="#0000BB">$_SESSION</font><font color="#007700">&#91;</font><font color="#DD0000">'SESS_LOGIN'</font><font color="#007700">&#93;) || </font><font color="#0000BB">$_SESSION</font><font color="#007700">&#91;</font><font color="#DD0000">'SESS_TYPE'</font><font color="#007700">&#93; !=</font><font color="#DD0000">'admin'</font><font color="#007700">)&nbsp;&nbsp;<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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;script language="javascript"&gt;'</font><font color="#007700">; <br />&nbsp;&nbsp;echo&nbsp;&nbsp;</font><font color="#DD0000">'alert("Please login as ADMINISTRATOR to edit a user");'</font><font color="#007700">;&nbsp;&nbsp;<br />&nbsp;&nbsp;echo&nbsp;&nbsp;</font><font color="#DD0000">'&lt;/script&gt;'</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />} <br />else <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include(</font><font color="#DD0000">"config.php"</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$tableName</font><font color="#007700">=</font><font color="#DD0000">"chemical"</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$targetpage </font><font color="#007700">= </font><font color="#DD0000">"view_all_chemical.php"</font><font color="#007700">; &nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$limit </font><font color="#007700">= </font><font color="#0000BB">5</font><font color="#007700">; <br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$query </font><font color="#007700">= </font><font color="#DD0000">"SELECT COUNT(*) as num FROM $tableName"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$total_pages </font><font color="#007700">= </font><font color="#0000BB">mysql_fetch_array</font><font color="#007700">(</font><font color="#0000BB">mysql_query</font><font color="#007700">(</font><font color="#0000BB">$query</font><font color="#007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$total_pages </font><font color="#007700">= </font><font color="#0000BB">$total_pages</font><font color="#007700">&#91;</font><font color="#0000BB">num</font><font color="#007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$stages </font><font color="#007700">= </font><font color="#0000BB">3</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$page </font><font color="#007700">= </font><font color="#0000BB">mysql_escape_string</font><font color="#007700">(</font><font color="#0000BB">$_GET</font><font color="#007700">&#91;</font><font color="#DD0000">'page'</font><font color="#007700">&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</font><font color="#0000BB">$page</font><font color="#007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$start </font><font color="#007700">= (</font><font color="#0000BB">$page </font><font color="#007700">- </font><font color="#0000BB">1</font><font color="#007700">) * </font><font color="#0000BB">$limit</font><font color="#007700">; <br />&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$start </font><font color="#007700">= </font><font color="#0000BB">0</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Get page data<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$query1 </font><font color="#007700">= </font><font color="#DD0000">"SELECT generalname, Scientificname, quantity, reorder FROM $tableName LIMIT $start, $limit"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$result </font><font color="#007700">= </font><font color="#0000BB">mysql_query</font><font color="#007700">(</font><font color="#0000BB">$query1</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Initial page num setup<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">if (</font><font color="#0000BB">$page </font><font color="#007700">== </font><font color="#0000BB">0</font><font color="#007700">){</font><font color="#0000BB">$page </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$prev </font><font color="#007700">= </font><font color="#0000BB">$page </font><font color="#007700">- </font><font color="#0000BB">1</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$next </font><font color="#007700">= </font><font color="#0000BB">$page </font><font color="#007700">+ </font><font color="#0000BB">1</font><font color="#007700">;&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 />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$lastpage </font><font color="#007700">= </font><font color="#0000BB">ceil</font><font color="#007700">(</font><font color="#0000BB">$total_pages</font><font color="#007700">/</font><font color="#0000BB">$limit</font><font color="#007700">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$LastPagem1 </font><font color="#007700">= </font><font color="#0000BB">$lastpage </font><font color="#007700">- </font><font color="#0000BB">1</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate </font><font color="#007700">= </font><font color="#DD0000">''</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</font><font color="#0000BB">$lastpage </font><font color="#007700">&gt; </font><font color="#0000BB">1</font><font color="#007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate </font><font color="#007700">.= </font><font color="#DD0000">"&lt;div class='paginate'&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Previous<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">if (</font><font color="#0000BB">$page </font><font color="#007700">&gt; </font><font color="#0000BB">1</font><font color="#007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$prev'&gt;previous&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;span class='disabled'&gt;previous&lt;/span&gt;"</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Pages&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">if (</font><font color="#0000BB">$lastpage </font><font color="#007700">&lt; </font><font color="#0000BB">7 </font><font color="#007700">+ (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">))&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Not enough pages to breaking it up<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">{&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$counter </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$counter </font><font color="#007700">&lt;= </font><font color="#0000BB">$lastpage</font><font color="#007700">; </font><font color="#0000BB">$counter</font><font color="#007700">++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$counter </font><font color="#007700">== </font><font color="#0000BB">$page</font><font color="#007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;span class='current'&gt;$counter&lt;/span&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$counter'&gt;$counter&lt;/a&gt;"</font><font color="#007700">;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elseif(</font><font color="#0000BB">$lastpage </font><font color="#007700">&gt; </font><font color="#0000BB">5 </font><font color="#007700">+ (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">))&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Enough pages to hide a few?<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Beginning only hide later pages<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">if(</font><font color="#0000BB">$page </font><font color="#007700">&lt; </font><font color="#0000BB">1 </font><font color="#007700">+ (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$counter </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$counter </font><font color="#007700">&lt; </font><font color="#0000BB">4 </font><font color="#007700">+ (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">); </font><font color="#0000BB">$counter</font><font color="#007700">++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$counter </font><font color="#007700">== </font><font color="#0000BB">$page</font><font 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;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;span class='current'&gt;$counter&lt;/span&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<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;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$counter'&gt;$counter&lt;/a&gt;"</font><font color="#007700">;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"..."</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$LastPagem1'&gt;$LastPagem1&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$lastpage'&gt;$lastpage&lt;/a&gt;"</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Middle hide some front and some back<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">elseif(</font><font color="#0000BB">$lastpage </font><font color="#007700">- (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">) &gt; </font><font color="#0000BB">$page </font><font color="#007700">&amp;&amp; </font><font color="#0000BB">$page </font><font color="#007700">&gt; (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=1'&gt;1&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=2'&gt;2&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"..."</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$counter </font><font color="#007700">= </font><font color="#0000BB">$page </font><font color="#007700">- </font><font color="#0000BB">$stages</font><font color="#007700">; </font><font color="#0000BB">$counter </font><font color="#007700">&lt;= </font><font color="#0000BB">$page </font><font color="#007700">+ </font><font color="#0000BB">$stages</font><font color="#007700">; </font><font color="#0000BB">$counter</font><font color="#007700">++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$counter </font><font color="#007700">== </font><font color="#0000BB">$page</font><font 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;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;span class='current'&gt;$counter&lt;/span&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<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;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$counter'&gt;$counter&lt;/a&gt;"</font><font color="#007700">;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"..."</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$LastPagem1'&gt;$LastPagem1&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$lastpage'&gt;$lastpage&lt;/a&gt;"</font><font color="#007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// End only hide early pages<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=1'&gt;1&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=2'&gt;2&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"..."</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$counter </font><font color="#007700">= </font><font color="#0000BB">$lastpage </font><font color="#007700">- (</font><font color="#0000BB">2 </font><font color="#007700">+ (</font><font color="#0000BB">$stages </font><font color="#007700">* </font><font color="#0000BB">2</font><font color="#007700">)); </font><font color="#0000BB">$counter </font><font color="#007700">&lt;= </font><font color="#0000BB">$lastpage</font><font color="#007700">; </font><font color="#0000BB">$counter</font><font color="#007700">++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$counter </font><font color="#007700">== </font><font color="#0000BB">$page</font><font 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;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;span class='current'&gt;$counter&lt;/span&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<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;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$counter'&gt;$counter&lt;/a&gt;"</font><font color="#007700">;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Next<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">if (</font><font color="#0000BB">$page </font><font color="#007700">&lt; </font><font color="#0000BB">$counter </font><font color="#007700">- </font><font color="#0000BB">1</font><font color="#007700">){ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;a href='$targetpage?page=$next'&gt;next&lt;/a&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;span class='disabled'&gt;next&lt;/span&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$paginate</font><font color="#007700">.= </font><font color="#DD0000">"&lt;/div&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />}<br /> <br /><br /></font><font color="#FF8000">// get results from database<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;$result = mysql_query("SELECT * FROM members") <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or die(mysql_error());&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// display data in table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">echo </font><font color="#DD0000">"&lt;table id='table'&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Code&lt;/th&gt; &lt;th&gt;Quantity&lt;/th&gt; &lt;th&gt;Reorder&lt;/th&gt;&lt;th&gt;Edit&lt;/th&gt;&lt;th&gt;Delete&lt;/th&gt;&lt;th&gt;Stock&lt;/th&gt;&nbsp;&nbsp;&lt;/tr&gt;"</font><font color="#007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// loop through results of database query, displaying them in the table<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">while(</font><font color="#0000BB">$row </font><font color="#007700">= </font><font color="#0000BB">mysql_fetch_array</font><font color="#007700">( </font><font color="#0000BB">$result </font><font color="#007700">)) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// echo out the contents of each row into a table<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;' </font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'generalname'</font><font color="#007700">&#93; . </font><font color="#DD0000">'&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;' </font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'Scientificname'</font><font color="#007700">&#93; . </font><font color="#DD0000">'&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;' </font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'quantity'</font><font color="#007700">&#93; . </font><font color="#DD0000">'&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;'</font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'reorder'</font><font color="#007700">&#93; . </font><font color="#DD0000">'&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;&lt;a href="editchemical.php?id=' </font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'id'</font><font color="#007700">&#93; . </font><font color="#DD0000">'"&gt;Edit&lt;/a&gt;&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;&lt;a href="delete_chemical.php?id=' </font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'id'</font><font color="#007700">&#93; . </font><font color="#DD0000">'"&gt;Delete&lt;/a&gt;&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;&lt;a href="stock_chemical.php?id=' </font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'id'</font><font color="#007700">&#93; . </font><font color="#DD0000">'"&gt;Stock&lt;/a&gt;&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//echo '&lt;td&gt;&lt;a href="edituser.php?id=' . $row&#91;'id'&#93; . '"&gt;Edit&lt;/a&gt;&lt;/td&gt;';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//echo '&lt;td&gt;&lt;a href="delete_user.php?id=' . $row&#91;'id'&#93; . '"&gt;Delete&lt;/a&gt;&lt;/td&gt;';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/table&gt;"</font><font color="#007700">; <br />echo </font><font color="#0000BB">$paginate</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">?&gt;</font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div><br />
This is the error it shows<br />
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>vidz</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384519</guid>
		</item>
		<item>
			<title>Naming convestion for the .xlsx file</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384518&amp;goto=newpost</link>
			<pubDate>Fri, 18 May 2012 10:30:57 GMT</pubDate>
			<description><![CDATA[The colon is not working in the name of .xlsx file 
when I use it without colon is fine but when i add colon I get don't get my excel fil generated
I am adding this colon to show time at which it has being generated

PHP:
---------
$created = date('d-m-Y H:i:s', time());
$file_path = $file_path.$result_group["correct_label"]."_".$created.".xlsx";
---------
how ever I read the document that tell u should avoid this 
\ (backslash)
/ (forward slash)
: (colon)
* (asterisk),
? (question mark)
" (double quotes)
< (left angle bracket)
>(right angle bracket)
| (pipe)
you can read the dcument Here (http://www.uwsuper.edu/technology/help/tips/upload/NamingFiles.pdf)

so what should I  use in place of that i don't want to use underscore
and don't want to use the timestamp the time should be in common man readable form
any suggestion will be appreciated]]></description>
			<content:encoded><![CDATA[<div>The colon is not working in the name of .xlsx file <br />
when I use it without colon is fine but when i add colon I get don't get my excel fil generated<br />
I am adding this colon to show time at which it has being generated<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
<font color="#0000BB">$created </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'d-m-Y H:i:s'</font><font color="#007700">, </font><font color="#0000BB">time</font><font color="#007700">());<br /></font><font color="#0000BB">$file_path </font><font color="#007700">= </font><font color="#0000BB">$file_path</font><font color="#007700">.</font><font color="#0000BB">$result_group</font><font color="#007700">&#91;</font><font color="#DD0000">"correct_label"</font><font color="#007700">&#93;.</font><font color="#DD0000">"_"</font><font color="#007700">.</font><font color="#0000BB">$created</font><font color="#007700">.</font><font color="#DD0000">".xlsx"</font><font color="#007700">; <br /></font><font color="#0000BB"></font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>how ever I read the document that tell u should avoid this <br />
\ (backslash)<br />
/ (forward slash)<br />
: (colon)<br />
* (asterisk),<br />
? (question mark)<br />
&quot; (double quotes)<br />
&lt; (left angle bracket)<br />
&gt;(right angle bracket)<br />
| (pipe)<br />
you can read the dcument <a rel="nofollow" href="http://www.uwsuper.edu/technology/help/tips/upload/NamingFiles.pdf" target="_blank">Here</a><br />
<br />
so what should I  use in place of that i don't want to use underscore<br />
and don't want to use the timestamp the time should be in common man readable form<br />
any suggestion will be appreciated</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=2">General Help</category>
			<dc:creator>vivek151189</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384518</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] random order within category based on day of month]]></title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384517&amp;goto=newpost</link>
			<pubDate>Fri, 18 May 2012 09:40:07 GMT</pubDate>
			<description><![CDATA[Hello
I want to order my db results randomly between three categories, so everything in category one will always appear above category two, etc.

Here is the code I have, which is working fine:


PHP:
---------
$query = "SELECT car, model FROM (SELECT * FROM cars ORDER BY RAND()) AS t ORDER BY orderno DESC";
---------
where orderno is the field containing the category numbers 1, 2, or 3.  However, I have pagination, so I only want the randomness to be changed daily.  How can I add a fixed number, like day of the month, to make sure the ordering is only updated once a day?

Many thanks for any suggestions!]]></description>
			<content:encoded><![CDATA[<div>Hello<br />
I want to order my db results randomly between three categories, so everything in category one will always appear above category two, etc.<br />
<br />
Here is the code I have, which is working fine:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
<font color="#0000BB">$query </font><font color="#007700">= </font><font color="#DD0000">"SELECT car, model FROM (SELECT * FROM cars ORDER BY RAND()) AS t ORDER BY orderno DESC"</font><font color="#007700">; <br /></font><font color="#0000BB"></font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>where orderno is the field containing the category numbers 1, 2, or 3.  However, I have pagination, so I only want the randomness to be changed daily.  How can I add a fixed number, like day of the month, to make sure the ordering is only updated once a day?<br />
<br />
Many thanks for any suggestions!</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=6">Database</category>
			<dc:creator>etoast</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384517</guid>
		</item>
		<item>
			<title>find average??</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384516&amp;goto=newpost</link>
			<pubDate>Fri, 18 May 2012 03:22:20 GMT</pubDate>
			<description><![CDATA[i have php script:
    <html>
    <body>
    <?php
    $conn = mysql_connect("localhost","root","");
    mysql_select_db("experiment",$conn);
    $sql = "select * from student inner join study where student.nis=study.nis;
    $result = mysql_query($sql) or die(mysql_error());
    
    $average = ????    

    ?>
    <table cellpadding="7" cellspacing="0" border="1">
    <tr>
    <th>nis</th>
    <th>name</th>
    <th>class</th>
    <th>math</th>
    <th>english</th>
    <th>physics</th>
    <th>average</th>
    </tr>
        
    <?php while($val = mysql_fetch_array($result)){?>
    <tr>
    <td><?php echo $val['nis'];?></td>
    <td><?php echo $val['name'];?></td>
    <td><?php echo $val['class'];?></td>
    <td><?php echo $val['math'];?></td>
    <td><?php echo $val['english'];?></td>
    <td><?php echo $val['physics'];?></td>
    <td><?php echo ?????       ;?></td>
    </tr>
    <?php }?>
    </table>
    </body>
    </html>
_________________________________________________________

how script for find average??
please help me?]]></description>
			<content:encoded><![CDATA[<div>i have php script:<br />
    &lt;html&gt;<br />
    &lt;body&gt;<br />
    &lt;?php<br />
    $conn = mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;);<br />
    mysql_select_db(&quot;experiment&quot;,$conn);<br />
    $sql = &quot;select * from student inner join study where student.nis=study.nis;<br />
    $result = mysql_query($sql) or die(mysql_error());<br />
    <br />
    $average = ????    <br />
<br />
    ?&gt;<br />
    &lt;table cellpadding=&quot;7&quot; cellspacing=&quot;0&quot; border=&quot;1&quot;&gt;<br />
    &lt;tr&gt;<br />
    &lt;th&gt;nis&lt;/th&gt;<br />
    &lt;th&gt;name&lt;/th&gt;<br />
    &lt;th&gt;class&lt;/th&gt;<br />
    &lt;th&gt;math&lt;/th&gt;<br />
    &lt;th&gt;english&lt;/th&gt;<br />
    &lt;th&gt;physics&lt;/th&gt;<br />
    &lt;th&gt;average&lt;/th&gt;<br />
    &lt;/tr&gt;<br />
        <br />
    &lt;?php while($val = mysql_fetch_array($result)){?&gt;<br />
    &lt;tr&gt;<br />
    &lt;td&gt;&lt;?php echo $val['nis'];?&gt;&lt;/td&gt;<br />
    &lt;td&gt;&lt;?php echo $val['name'];?&gt;&lt;/td&gt;<br />
    &lt;td&gt;&lt;?php echo $val['class'];?&gt;&lt;/td&gt;<br />
    &lt;td&gt;&lt;?php echo $val['math'];?&gt;&lt;/td&gt;<br />
    &lt;td&gt;&lt;?php echo $val['english'];?&gt;&lt;/td&gt;<br />
    &lt;td&gt;&lt;?php echo $val['physics'];?&gt;&lt;/td&gt;<br />
    &lt;td&gt;&lt;?php echo ?????       ;?&gt;&lt;/td&gt;<br />
    &lt;/tr&gt;<br />
    &lt;?php }?&gt;<br />
    &lt;/table&gt;<br />
    &lt;/body&gt;<br />
    &lt;/html&gt;<br />
_________________________________________________________<br />
<br />
how script for find average??<br />
please help me?</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>hasan_alghazi</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384516</guid>
		</item>
		<item>
			<title><![CDATA[My sytax is being complained about, but I don't know why.]]></title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384515&amp;goto=newpost</link>
			<pubDate>Fri, 18 May 2012 01:55:10 GMT</pubDate>
			<description><![CDATA[Hi there guys,

Here's my statement:


Code:
---------
mysql_query("UPDATE addon_guild_members SET gender = '$mgender', level = '$mlevel', race = '$mrace', class = '$mclass', rank = '$mrank', last_time = NOW(), active = '1', key = '$current_key'  WHERE name = '$mname'") or die("Failed to update member in the database.<br><br>" . mysql_error());
---------
Which worked fine until I added this:


---Quote---
, key = '$current_key'
---End Quote---
When I added that, the statement broke and I get this:


---Quote---
Failed to update member in the database.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key = '146451373' WHERE name = 'Govannin'' at line 1
---End Quote---
Can someone tell me what I did wrong?]]></description>
			<content:encoded><![CDATA[<div>Hi there guys,<br />
<br />
Here's my statement:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">mysql_query(&quot;UPDATE addon_guild_members SET gender = '$mgender', level = '$mlevel', race = '$mrace', class = '$mclass', rank = '$mrank', last_time = NOW(), active = '1', key = '$current_key'&nbsp; WHERE name = '$mname'&quot;) or die(&quot;Failed to update member in the database.&lt;br&gt;&lt;br&gt;&quot; . mysql_error());</code><hr />
</div>Which worked fine until I added this:<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				, key = '$current_key'
			
			<hr />
		</td>
	</tr>
	</table>
</div>When I added that, the statement broke and I get this:<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				Failed to update member in the database.<br />
<br />
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key = '146451373' WHERE name = 'Govannin'' at line 1
			
			<hr />
		</td>
	</tr>
	</table>
</div>Can someone tell me what I did wrong?</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=6">Database</category>
			<dc:creator>schwim</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384515</guid>
		</item>
		<item>
			<title>jquery with php</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384514&amp;goto=newpost</link>
			<pubDate>Fri, 18 May 2012 01:53:07 GMT</pubDate>
			<description><![CDATA[I have a function which creates a table dynamically:

PHP:
---------
function create_table($item) {
	$title = $item->post_title;
	$date = date('M-d-Y H:i:s e',strtotime($item->post_date));
	echo '<tr>';
	echo '<td><input type="checkbox" /></td>';
	echo '<td>' . $title . '</td>';
	echo '<td>' . $date . '</td>';
	echo  '</tr>';
	return $csv_output .=  $title . ', ' . $date .  "\n"; // only return this if ckbox is checked
}
---------
this creates a table with a checkbox. i want the user to be able to check the checkbox and if it's checked return the last line - return $csv_output... 
when i add jquery or just the script tags to it, the table only returns 1 row and looks funny...

any suggestions?

thanks!]]></description>
			<content:encoded><![CDATA[<div>I have a function which creates a table dynamically:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
<font color="#0000BB"></font><font color="#007700">function </font><font color="#0000BB">create_table</font><font color="#007700">(</font><font color="#0000BB">$item</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$title </font><font color="#007700">= </font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">post_title</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$date </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'M-d-Y H:i:s e'</font><font color="#007700">,</font><font color="#0000BB">strtotime</font><font color="#007700">(</font><font color="#0000BB">$item</font><font color="#007700">-&gt;</font><font color="#0000BB">post_date</font><font color="#007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;tr&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;' </font><font color="#007700">. </font><font color="#0000BB">$title </font><font color="#007700">. </font><font color="#DD0000">'&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;td&gt;' </font><font color="#007700">. </font><font color="#0000BB">$date </font><font color="#007700">. </font><font color="#DD0000">'&lt;/td&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;&nbsp;</font><font color="#DD0000">'&lt;/tr&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;return </font><font color="#0000BB">$csv_output </font><font color="#007700">.=&nbsp;&nbsp;</font><font color="#0000BB">$title </font><font color="#007700">. </font><font color="#DD0000">', ' </font><font color="#007700">. </font><font color="#0000BB">$date </font><font color="#007700">.&nbsp;&nbsp;</font><font color="#DD0000">"\n"</font><font color="#007700">; </font><font color="#FF8000">// only return this if ckbox is checked<br /></font><font color="#007700">} <br /></font><font color="#0000BB"></font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>this creates a table with a checkbox. i want the user to be able to check the checkbox and if it's checked return the last line - return $csv_output... <br />
when i add jquery or just the script tags to it, the table only returns 1 row and looks funny...<br />
<br />
any suggestions?<br />
<br />
thanks!</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>fxpepper</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384514</guid>
		</item>
		<item>
			<title>how make table</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384513&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 23:47:03 GMT</pubDate>
			<description>I have a problem with the table.
for example.
1. test 5 times
2. 3 subjects (math, English, physics)
3. grade 3 pieces (A, B, C)
4. identity (id, name, grade, gender)
how to create a table of the above problems, including primary and foreign keys.
please help me!!!</description>
			<content:encoded><![CDATA[<div>I have a problem with the table.<br />
for example.<br />
1. test 5 times<br />
2. 3 subjects (math, English, physics)<br />
3. grade 3 pieces (A, B, C)<br />
4. identity (id, name, grade, gender)<br />
how to create a table of the above problems, including primary and foreign keys.<br />
please help me!!!</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>hasan_alghazi</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384513</guid>
		</item>
		<item>
			<title>Need help determining time difference</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384512&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 22:01:14 GMT</pubDate>
			<description><![CDATA[Hi there guys,

I'm trying very hard to figure out a way to determine whether current time is 60 minutes past a stored time.  I am having a horrible time.  Here's what I've got:


PHP:
---------
<?php

include("./includes/header.php");

//Check to see whether cron needs to run.
$query = "SELECT DATE_format(roster_update, '%b %d %Y %h:%i %p') as roster_update, DATE_format(NOW(), '%b %d %Y %h:%i %p') as cur_time FROM addon_cron";
$result = mysql_query ($query) or die('MySQL error: ' . mysql_error() . '<hr/>' . $query);
$result_rows = mysql_num_rows($result);
if($result_rows==0){

	//Danger, Will Robinson!  No data found in db for cron!
	echo("
	Error: Cron time missing for roster_update.
	");

}else{

	//Grab the last run time for roster_update
	$result = mysql_query ($query);
	while ($row = mysql_fetch_assoc ($result)) {
		$roster_update = strtotime($row['roster_update']);
		$cur_time = strtotime($row['cur_time']);		
		
		echo $roster_update."<br />".$cur_time."<br />";
		
		if($cur_time >= ($roster_update+(60*60))){

			echo("<p align='center'>Over 60 minutes.</p>");
			
			
		}else{
		
		// Time is under one hour.
		echo("<p align='center'>under 60 minutes.</p>");
		
		}
	}
}

?>
---------
I've set the database time four hours in the past and it's still telling me that it's under an hour.

Could someone tell me how To get this to work?

Thanks a bunch for your time!]]></description>
			<content:encoded><![CDATA[<div>Hi there guys,<br />
<br />
I'm trying very hard to figure out a way to determine whether current time is 60 minutes past a stored time.  I am having a horrible time.  Here's what I've got:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /><br /></font><font color="#007700">include(</font><font color="#DD0000">"./includes/header.php"</font><font color="#007700">);<br /><br /></font><font color="#FF8000">//Check to see whether cron needs to run.<br /></font><font color="#0000BB">$query </font><font color="#007700">= </font><font color="#DD0000">"SELECT DATE_format(roster_update, '%b %d %Y %h:%i %p') as roster_update, DATE_format(NOW(), '%b %d %Y %h:%i %p') as cur_time FROM addon_cron"</font><font color="#007700">;<br /></font><font color="#0000BB">$result </font><font color="#007700">= </font><font color="#0000BB">mysql_query </font><font color="#007700">(</font><font color="#0000BB">$query</font><font color="#007700">) or die(</font><font color="#DD0000">'MySQL error: ' </font><font color="#007700">. </font><font color="#0000BB">mysql_error</font><font color="#007700">() . </font><font color="#DD0000">'&lt;hr/&gt;' </font><font color="#007700">. </font><font color="#0000BB">$query</font><font color="#007700">);<br /></font><font color="#0000BB">$result_rows </font><font color="#007700">= </font><font color="#0000BB">mysql_num_rows</font><font color="#007700">(</font><font color="#0000BB">$result</font><font color="#007700">);<br />if(</font><font color="#0000BB">$result_rows</font><font color="#007700">==</font><font color="#0000BB">0</font><font color="#007700">){<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//Danger, Will Robinson!&nbsp;&nbsp;No data found in db for cron!<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">echo(</font><font color="#DD0000">"<br />&nbsp;&nbsp;&nbsp;&nbsp;Error: Cron time missing for roster_update.<br />&nbsp;&nbsp;&nbsp;&nbsp;"</font><font color="#007700">);<br /><br />}else{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">//Grab the last run time for roster_update<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$result </font><font color="#007700">= </font><font color="#0000BB">mysql_query </font><font color="#007700">(</font><font color="#0000BB">$query</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;while (</font><font color="#0000BB">$row </font><font color="#007700">= </font><font color="#0000BB">mysql_fetch_assoc </font><font color="#007700">(</font><font color="#0000BB">$result</font><font color="#007700">)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$roster_update </font><font color="#007700">= </font><font color="#0000BB">strtotime</font><font color="#007700">(</font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'roster_update'</font><font color="#007700">&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$cur_time </font><font color="#007700">= </font><font color="#0000BB">strtotime</font><font color="#007700">(</font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'cur_time'</font><font color="#007700">&#93;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$roster_update</font><font color="#007700">.</font><font color="#DD0000">"&lt;br /&gt;"</font><font color="#007700">.</font><font color="#0000BB">$cur_time</font><font color="#007700">.</font><font color="#DD0000">"&lt;br /&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</font><font color="#0000BB">$cur_time </font><font color="#007700">&gt;= (</font><font color="#0000BB">$roster_update</font><font color="#007700">+(</font><font color="#0000BB">60</font><font color="#007700">*</font><font color="#0000BB">60</font><font color="#007700">))){<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo(</font><font color="#DD0000">"&lt;p align='center'&gt;Over 60 minutes.&lt;/p&gt;"</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF8000">// Time is under one hour.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">echo(</font><font color="#DD0000">"&lt;p align='center'&gt;under 60 minutes.&lt;/p&gt;"</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br /></font><font color="#0000BB">?&gt;</font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>I've set the database time four hours in the past and it's still telling me that it's under an hour.<br />
<br />
Could someone tell me how To get this to work?<br />
<br />
Thanks a bunch for your time!</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>schwim</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384512</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] Truncate text to display only 20 characters]]></title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384511&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 21:44:49 GMT</pubDate>
			<description><![CDATA[Hello,

I have a <h3> tag that uses .php to display titles. This <h3> tag only has enough space to display one line of text. Sometimes the title is too long to fit and the title goes into two lines. I would like to truncate the text after 20 characters. Is there an easy way to do this? Here is the code:


Code:
---------
<h3><?php echo $this->htmlLink($cause->getHref(), $cause->getTitle()) ?></h3>
---------
Thank you,
Ken]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I have a &lt;h3&gt; tag that uses .php to display titles. This &lt;h3&gt; tag only has enough space to display one line of text. Sometimes the title is too long to fit and the title goes into two lines. I would like to truncate the text after 20 characters. Is there an easy way to do this? Here is the code:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;h3&gt;&lt;?php echo $this-&gt;htmlLink($cause-&gt;getHref(), $cause-&gt;getTitle()) ?&gt;&lt;/h3&gt;</code><hr />
</div>Thank you,<br />
Ken</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>khong</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384511</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] How to show dropdown list value in edit item form]]></title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384510&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 21:40:54 GMT</pubDate>
			<description><![CDATA[Iam working on edit script. My problem is how to drop down list's current value(value from the db) and this should be shown in drop down list. Because it should be editable. Iam ok with showing values in text fiels and all.]]></description>
			<content:encoded><![CDATA[<div>Iam working on edit script. My problem is how to drop down list's current value(value from the db) and this should be shown in drop down list. Because it should be editable. Iam ok with showing values in text fiels and all.</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>vidz</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384510</guid>
		</item>
		<item>
			<title>Query using Date</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384508&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 16:48:43 GMT</pubDate>
			<description><![CDATA[What I wanna do is update a field in a row based on the date.  

UPDATE tabe SET field=field-field*variable WHERE date 


What i cant figure out how to do is count days if date >=7 AND date <=13 Variable =.10  also keep going with it IF date >=14 AND date <=20 Variable =.20

What i cant figure out is how to count how many days away date is from the curdate

so if Date=2012-04-20 I wanna know how to count how many days that is from curdate

Now im pretty sure I can figure out how to do this if someone can help me in counting days date is from today.]]></description>
			<content:encoded><![CDATA[<div>What I wanna do is update a field in a row based on the date.  <br />
<br />
UPDATE tabe SET field=field-field*variable WHERE date <br />
<br />
<br />
What i cant figure out how to do is count days if date &gt;=7 AND date &lt;=13 Variable =.10  also keep going with it IF date &gt;=14 AND date &lt;=20 Variable =.20<br />
<br />
What i cant figure out is how to count how many days away date is from the curdate<br />
<br />
so if Date=2012-04-20 I wanna know how to count how many days that is from curdate<br />
<br />
Now im pretty sure I can figure out how to do this if someone can help me in counting days date is from today.</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=6">Database</category>
			<dc:creator>Mark Nordstrom</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384508</guid>
		</item>
		<item>
			<title>How to send values from a Calendar?</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384507&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 14:17:34 GMT</pubDate>
			<description><![CDATA[Hello everybody, I would make sure that the numeric values &#8203;&#8203;included in the file "index.php" will be sent to "report.php" and then can not be changed.


Thanks

Like this: http://thaypan.altervista.org/Time_Tracking__Project_Management.png

index.php


PHP:
---------
    <script type="text/javascript">
        function somma_valori(form) {       
            var elementi = form.elements.length;
            var somma = 0;
            for(var i = 0; i < elementi; i++){
                if(form.elements[i].name != "invia") {
                    var valore = parseInt(form.elements[i].value);
                    if(isNaN(valore))
                        valore = 0;               
                    somma = somma + valore;
                }
            }
            document.getElementById('somma').innerHTML = somma
        }
    </script>
    <style type="text/css">
        table{
            font-family:Arial, Helvetica, sans-serif;
            font-size:12px;
            text-align:center;
            background-color:#F1F1F1;
        }
        .dom{
            background-color:#FF6600;
        }
        .sab{
            background-color: #FFFFCC;
        }
        .oggi{
            border-width:2px;
            border-color: #009900;
            border-style:solid;
            font-weight:bold;
        }
        .me{
            font-family:Arial, Helvetica, sans-serif;
            font-size:14px;
            font-weight:bold;
        }
    </style>
    <?php
    $month = date('m');
    $year = date('Y');
    $oggi = date("d") + 0;
    $giorni_settimana = array(1, "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom");
    $mese = array('Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre');
    $time_primo_del_mese = mktime(0, 0, 0, $month, 1, $year);
    $primo_del_mese = date('w', $time_primo_del_mese);
    $giorni_nel_mese = cal_days_in_month(CAL_GREGORIAN, $month, $year);
    echo "<span class=\"me\">" . $mese[($month - 1)] . "</span>";


    echo "<table border='1'>";
    echo "<form action='reports.php' method='post'>";
    echo "<tr>";
    $g = $primo_del_mese;
    for ($i = 1; $i <= $giorni_nel_mese; $i++) {
        $classe = "";
        if ($giorni_settimana[$g] == "Dom") {
            $classe = " class=\"dom\"";
        } elseif ($giorni_settimana[$g] == "Sab") {
            $classe = " class=\"sab\"";
        }
        echo "<td $classe>" . $giorni_settimana[$g] . "</td>";
        if ($g == 7) {
            $g = 1;
        } else {
            $g++;
        }
    }
    echo "</tr>";
    echo "<tr>";
    for ($i = 1; $i <= $giorni_nel_mese; $i++) {
        $classe = "";
        if ($i == $oggi) {
            $classe = " class=\"oggi\"";
        }
        echo "<td $classe>$i</td>";
    }
    echo "</tr>";
    echo "<tr>";
    for ($i = 1; $i <= $giorni_nel_mese; $i++) {
        echo "<td><input type='text' onkeyup='somma_valori(this.form)' size='1' name='" . $year . "-" . $month . "-" . $i . "'/></td>\n";
    }
    echo "</tr>";
    echo "<tr>";
    echo "<td colspan='$i'>";
    echo "Totale : <span id='somma'>0</span> &nbsp;";
    echo "&nbsp;<input type='submit' name='invia' value='Invia'/>";
    echo "</td>";
    echo "</tr>";
    echo "</form>";
    echo "</table>";
    ?>
---------
reports.pgp


PHP:
---------
    <?php

    $month = date('m');
    $year = date('Y');

    $giorni_settimana = array(1, "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom");

    $time_primo_del_mese = mktime(0, 0, 0, $month, 1, $year);
    $primo_del_mese = date('w', $time_primo_del_mese);

    $giorni_nel_mese = cal_days_in_month(CAL_GREGORIAN, $month, $year);

    echo "<table border='1'>";
    echo "<tr>";
    $g = $primo_del_mese;
    for ($i = 1; $i <= $giorni_nel_mese; $i++) {
        echo "<td>" . $giorni_settimana[$g] . "</td>";
        if ($g == 7) {
            $g = 1;
        } else {
            $g++;
        }
    }
    echo "</tr>";
    echo "<tr>";
    for ($i = 1; $i <= $giorni_nel_mese; $i++) {
        echo "<td>$i</td>";
    }
    echo "</tr>";
    echo "</table>";

    unset($_POST['invia']);
    foreach ($_POST as $key => $value) {
        (int) $value;

        if ($value != 0) {
            echo $key . "->" . $value . "<br/>";
        }
    }
    ?>
---------
]]></description>
			<content:encoded><![CDATA[<div>Hello everybody, I would make sure that the numeric values &#8203;&#8203;included in the file &quot;index.php&quot; will be sent to &quot;report.php&quot; and then can not be changed.<br />
<br />
<br />
Thanks<br />
<br />
Like this: <a rel="nofollow" href="http://thaypan.altervista.org/Time_Tracking__Project_Management.png" target="_blank">http://thaypan.altervista.org/Time_T...Management.png</a><br />
<br />
index.php<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
&nbsp;&nbsp;&nbsp;&nbsp;&lt;script type="text/javascript"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function somma_valori(form) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var elementi = form.elements.length;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var somma = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(var i = 0; i &lt; elementi; i++){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(form.elements&#91;i&#93;.name != "invia") {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var valore = parseInt(form.elements&#91;i&#93;.value);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isNaN(valore))<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;valore = 0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;somma = somma + valore;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById('somma').innerHTML = somma<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;style type="text/css"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-family:Arial, Helvetica, sans-serif;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size:12px;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text-align:center;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background-color:#F1F1F1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.dom{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background-color:#FF6600;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.sab{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background-color: #FFFFCC;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.oggi{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;border-width:2px;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;border-color: #009900;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;border-style:solid;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-weight:bold;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.me{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-family:Arial, Helvetica, sans-serif;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size:14px;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-weight:bold;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/style&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$month </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'m'</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$year </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'Y'</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$oggi </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">"d"</font><font color="#007700">) + </font><font color="#0000BB">0</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$giorni_settimana </font><font color="#007700">= array(</font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#DD0000">"Lun"</font><font color="#007700">, </font><font color="#DD0000">"Mar"</font><font color="#007700">, </font><font color="#DD0000">"Mer"</font><font color="#007700">, </font><font color="#DD0000">"Gio"</font><font color="#007700">, </font><font color="#DD0000">"Ven"</font><font color="#007700">, </font><font color="#DD0000">"Sab"</font><font color="#007700">, </font><font color="#DD0000">"Dom"</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$mese </font><font color="#007700">= array(</font><font color="#DD0000">'Gennaio'</font><font color="#007700">, </font><font color="#DD0000">'Febbraio'</font><font color="#007700">, </font><font color="#DD0000">'Marzo'</font><font color="#007700">, </font><font color="#DD0000">'Aprile'</font><font color="#007700">, </font><font color="#DD0000">'Maggio'</font><font color="#007700">, </font><font color="#DD0000">'Giugno'</font><font color="#007700">, </font><font color="#DD0000">'Luglio'</font><font color="#007700">, </font><font color="#DD0000">'Agosto'</font><font color="#007700">, </font><font color="#DD0000">'Settembre'</font><font color="#007700">, </font><font color="#DD0000">'Ottobre'</font><font color="#007700">, </font><font color="#DD0000">'Novembre'</font><font color="#007700">, </font><font color="#DD0000">'Dicembre'</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$time_primo_del_mese </font><font color="#007700">= </font><font color="#0000BB">mktime</font><font color="#007700">(</font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">$month</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">$year</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$primo_del_mese </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'w'</font><font color="#007700">, </font><font color="#0000BB">$time_primo_del_mese</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$giorni_nel_mese </font><font color="#007700">= </font><font color="#0000BB">cal_days_in_month</font><font color="#007700">(</font><font color="#0000BB">CAL_GREGORIAN</font><font color="#007700">, </font><font color="#0000BB">$month</font><font color="#007700">, </font><font color="#0000BB">$year</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;span class=\"me\"&gt;" </font><font color="#007700">. </font><font color="#0000BB">$mese</font><font color="#007700">&#91;(</font><font color="#0000BB">$month </font><font color="#007700">- </font><font color="#0000BB">1</font><font color="#007700">)&#93; . </font><font color="#DD0000">"&lt;/span&gt;"</font><font color="#007700">;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;table border='1'&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;form action='reports.php' method='post'&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$g </font><font color="#007700">= </font><font color="#0000BB">$primo_del_mese</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$i </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$i </font><font color="#007700">&lt;= </font><font color="#0000BB">$giorni_nel_mese</font><font color="#007700">; </font><font color="#0000BB">$i</font><font color="#007700">++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$classe </font><font color="#007700">= </font><font color="#DD0000">""</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$giorni_settimana</font><font color="#007700">&#91;</font><font color="#0000BB">$g</font><font color="#007700">&#93; == </font><font color="#DD0000">"Dom"</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$classe </font><font color="#007700">= </font><font color="#DD0000">" class=\"dom\""</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} elseif (</font><font color="#0000BB">$giorni_settimana</font><font color="#007700">&#91;</font><font color="#0000BB">$g</font><font color="#007700">&#93; == </font><font color="#DD0000">"Sab"</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$classe </font><font color="#007700">= </font><font color="#DD0000">" class=\"sab\""</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;td $classe&gt;" </font><font color="#007700">. </font><font color="#0000BB">$giorni_settimana</font><font color="#007700">&#91;</font><font color="#0000BB">$g</font><font color="#007700">&#93; . </font><font color="#DD0000">"&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$g </font><font color="#007700">== </font><font color="#0000BB">7</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$g </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$g</font><font color="#007700">++;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$i </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$i </font><font color="#007700">&lt;= </font><font color="#0000BB">$giorni_nel_mese</font><font color="#007700">; </font><font color="#0000BB">$i</font><font color="#007700">++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$classe </font><font color="#007700">= </font><font color="#DD0000">""</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$i </font><font color="#007700">== </font><font color="#0000BB">$oggi</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$classe </font><font color="#007700">= </font><font color="#DD0000">" class=\"oggi\""</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;td $classe&gt;$i&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$i </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$i </font><font color="#007700">&lt;= </font><font color="#0000BB">$giorni_nel_mese</font><font color="#007700">; </font><font color="#0000BB">$i</font><font color="#007700">++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;td&gt;&lt;input type='text' onkeyup='somma_valori(this.form)' size='1' name='" </font><font color="#007700">. </font><font color="#0000BB">$year </font><font color="#007700">. </font><font color="#DD0000">"-" </font><font color="#007700">. </font><font color="#0000BB">$month </font><font color="#007700">. </font><font color="#DD0000">"-" </font><font color="#007700">. </font><font color="#0000BB">$i </font><font color="#007700">. </font><font color="#DD0000">"'/&gt;&lt;/td&gt;\n"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;td colspan='$i'&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"Totale : &lt;span id='somma'&gt;0&lt;/span&gt; &amp;nbsp;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&amp;nbsp;&lt;input type='submit' name='invia' value='Invia'/&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/form&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/table&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">?&gt;</font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>reports.pgp<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000BB">&lt;?php<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;$month </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'m'</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$year </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'Y'</font><font color="#007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$giorni_settimana </font><font color="#007700">= array(</font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#DD0000">"Lun"</font><font color="#007700">, </font><font color="#DD0000">"Mar"</font><font color="#007700">, </font><font color="#DD0000">"Mer"</font><font color="#007700">, </font><font color="#DD0000">"Gio"</font><font color="#007700">, </font><font color="#DD0000">"Ven"</font><font color="#007700">, </font><font color="#DD0000">"Sab"</font><font color="#007700">, </font><font color="#DD0000">"Dom"</font><font color="#007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$time_primo_del_mese </font><font color="#007700">= </font><font color="#0000BB">mktime</font><font color="#007700">(</font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">$month</font><font color="#007700">, </font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">$year</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$primo_del_mese </font><font color="#007700">= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'w'</font><font color="#007700">, </font><font color="#0000BB">$time_primo_del_mese</font><font color="#007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$giorni_nel_mese </font><font color="#007700">= </font><font color="#0000BB">cal_days_in_month</font><font color="#007700">(</font><font color="#0000BB">CAL_GREGORIAN</font><font color="#007700">, </font><font color="#0000BB">$month</font><font color="#007700">, </font><font color="#0000BB">$year</font><font color="#007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;table border='1'&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$g </font><font color="#007700">= </font><font color="#0000BB">$primo_del_mese</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$i </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$i </font><font color="#007700">&lt;= </font><font color="#0000BB">$giorni_nel_mese</font><font color="#007700">; </font><font color="#0000BB">$i</font><font color="#007700">++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;td&gt;" </font><font color="#007700">. </font><font color="#0000BB">$giorni_settimana</font><font color="#007700">&#91;</font><font color="#0000BB">$g</font><font color="#007700">&#93; . </font><font color="#DD0000">"&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$g </font><font color="#007700">== </font><font color="#0000BB">7</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$g </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$g</font><font color="#007700">++;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;for (</font><font color="#0000BB">$i </font><font color="#007700">= </font><font color="#0000BB">1</font><font color="#007700">; </font><font color="#0000BB">$i </font><font color="#007700">&lt;= </font><font color="#0000BB">$giorni_nel_mese</font><font color="#007700">; </font><font color="#0000BB">$i</font><font color="#007700">++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;td&gt;$i&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">"&lt;/table&gt;"</font><font color="#007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;unset(</font><font color="#0000BB">$_POST</font><font color="#007700">&#91;</font><font color="#DD0000">'invia'</font><font color="#007700">&#93;);<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach (</font><font color="#0000BB">$_POST </font><font color="#007700">as </font><font color="#0000BB">$key </font><font color="#007700">=&gt; </font><font color="#0000BB">$value</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(int) </font><font color="#0000BB">$value</font><font color="#007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">$value </font><font color="#007700">!= </font><font color="#0000BB">0</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$key </font><font color="#007700">. </font><font color="#DD0000">"-&gt;" </font><font color="#007700">. </font><font color="#0000BB">$value </font><font color="#007700">. </font><font color="#DD0000">"&lt;br/&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">?&gt;</font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div></div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>thaypan</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384507</guid>
		</item>
		<item>
			<title>$row entry to variable to form submission and retrieval</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384506&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 13:59:00 GMT</pubDate>
			<description><![CDATA[Hi, Im at a standstill.

I have a MYSQL database which has a name and amount field that automatically generates a random number when the details get uploaded via form and submitted.  The information is then displayed on another and the values generated are assigned to the <name> parameter in the form so that each field generated has a unique value, you with me so far?

So to confirm I have a form that the user fills out and it has two hidden fields that are automatically given random values when submitted to the database.  This is then retrieved on another page and the random values are assigned to the name value in another form.

I want the user to fill out this form and have each value submitted to another page and shown.

I shall post my code and if anyone could help me with this issue I would be most grateful.  Thank you!

Form in which the data from the database is assigned to the name tag:


PHP:
---------
                       <form method="post" action="step4.php">
         <table class="food">
         <?php
         
         $con = mysql_connect("database details");
         if (!$con)
           {
           die('Could not connect: ' . mysql_error());
           }

         mysql_select_db("catering", $con);

         $result= mysql_query("SELECT * FROM starters WHERE category='meat'");
         
         while($row = mysql_fetch_array($result))
         {
         
         echo"<tr>";
         echo"<td>";
         echo"<p class=\"form2\">";
         echo $row["title"];
         echo " - £";
         echo $row["price"];
         echo"<br>";
         echo"<span class=\"subtext\">". $row['subtext'] . "</span>";
         echo"</p>";
         echo"</td>";
         echo"<td class=\"addon\">";
         echo"<input type=\"checkbox\" class=\"largecheckbox\" name=". $row['nameid'] .">";
         echo"</td>";
         echo"<td class=\"addon\">";
         echo"<input type=\"text\" class=\"amount\" name=". $row['amountid'] .">";
         echo"</td>";
         echo"</tr>";
         }
         echo "";
         
         mysql_close($con);
         ?>
         
         </table>
         </div>
      
      <div id="bottom">
         <div id="build"></div>
         <div id="backbutt"><a href="step2.html"><img src="./images/prevbutt.png"></a></div>
         <div id="nextbutt"><input type="image" src="./images/nextbutt.png"></div>
         </form>
         </div>
      </div>
      
      <div id="footer">
      <p class="footer">Mistrys Catering | 01234 567 890 | example@example.com</p>
      </div>
      
   </div>
</body>
</html>
---------
How would I go about taking the values randomly generated and get them to be an actual name value, so that the information typed into the form can be passed properly from one form to the next, I have tried variables and sessions and im getting no errors, but nothing displays results wise, so I dont know what im doing wrong.]]></description>
			<content:encoded><![CDATA[<div>Hi, Im at a standstill.<br />
<br />
I have a MYSQL database which has a name and amount field that automatically generates a random number when the details get uploaded via form and submitted.  The information is then displayed on another and the values generated are assigned to the &lt;name&gt; parameter in the form so that each field generated has a unique value, you with me so far?<br />
<br />
So to confirm I have a form that the user fills out and it has two hidden fields that are automatically given random values when submitted to the database.  This is then retrieved on another page and the random values are assigned to the name value in another form.<br />
<br />
I want the user to fill out this form and have each value submitted to another page and shown.<br />
<br />
I shall post my code and if anyone could help me with this issue I would be most grateful.  Thank you!<br />
<br />
Form in which the data from the database is assigned to the name tag:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
	<div class="alt2">
		<hr />
		<code style="white-space:nowrap">
		<div dir="ltr" style="text-align:left;">
			<!-- php buffer start --><code><font color="#000000">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;form method="post" action="step4.php"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;table class="food"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$con </font><font color="#007700">= </font><font color="#0000BB">mysql_connect</font><font color="#007700">(</font><font color="#DD0000">"database details"</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!</font><font color="#0000BB">$con</font><font color="#007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(</font><font color="#DD0000">'Could not connect: ' </font><font color="#007700">. </font><font color="#0000BB">mysql_error</font><font color="#007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">mysql_select_db</font><font color="#007700">(</font><font color="#DD0000">"catering"</font><font color="#007700">, </font><font color="#0000BB">$con</font><font color="#007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$result</font><font color="#007700">= </font><font color="#0000BB">mysql_query</font><font color="#007700">(</font><font color="#DD0000">"SELECT * FROM starters WHERE category='meat'"</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(</font><font color="#0000BB">$row </font><font color="#007700">= </font><font color="#0000BB">mysql_fetch_array</font><font color="#007700">(</font><font color="#0000BB">$result</font><font color="#007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;p class=\"form2\"&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">"title"</font><font color="#007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">" - £"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">"price"</font><font color="#007700">&#93;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;br&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;span class=\"subtext\"&gt;"</font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'subtext'</font><font color="#007700">&#93; . </font><font color="#DD0000">"&lt;/span&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;/p&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;td class=\"addon\"&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;input type=\"checkbox\" class=\"largecheckbox\" name="</font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'nameid'</font><font color="#007700">&#93; .</font><font color="#DD0000">"&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;td class=\"addon\"&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;input type=\"text\" class=\"amount\" name="</font><font color="#007700">. </font><font color="#0000BB">$row</font><font color="#007700">&#91;</font><font color="#DD0000">'amountid'</font><font color="#007700">&#93; .</font><font color="#DD0000">"&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;/td&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo</font><font color="#DD0000">"&lt;/tr&gt;"</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">""</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">mysql_close</font><font color="#007700">(</font><font color="#0000BB">$con</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">?&gt;<br /></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="bottom"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="build"&gt;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="backbutt"&gt;&lt;a href="step2.html"&gt;&lt;img src="./images/prevbutt.png"&gt;&lt;/a&gt;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="nextbutt"&gt;&lt;input type="image" src="./images/nextbutt.png"&gt;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/form&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="footer"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p class="footer"&gt;Mistrys Catering | 01234 567 890 | example@example.com&lt;/p&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>How would I go about taking the values randomly generated and get them to be an actual name value, so that the information typed into the form can be passed properly from one form to the next, I have tried variables and sessions and im getting no errors, but nothing displays results wise, so I dont know what im doing wrong.</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>uncaringuser</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384506</guid>
		</item>
		<item>
			<title>Logging Visitor’s IP</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384505&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 10:39:45 GMT</pubDate>
			<description><![CDATA[Hi All, 

I'm new to the PHP Builder and i'm hoping someone can help me. 

Basically I have a website and want to record some of my visitors details for potential marketing purposes I found an example script online from ... 
http://tournasdimitrios1.wordpress.com/2012/01/14/logging-visitors-ip-with-php/#comment-1046


However when I try and test this (see attachment) it does not function. 
PHP is enabled on the server as I have PHP feedback forms already running which are working fine. 

When I open the log file in notepadd++ it does not appear to highlight, i'm worried why its not recognising it as PHP. I double checked and wrote some PHP on a new page and it worked fine so i'm a bit confused as to what to do. Can anyone please help, i'm sure its something ridiculous i'm not seeing. 

Thank you for your time]]></description>
			<content:encoded><![CDATA[<div>Hi All, <br />
<br />
I'm new to the PHP Builder and i'm hoping someone can help me. <br />
<br />
Basically I have a website and want to record some of my visitors details for potential marketing purposes I found an example script online from ... <br />
<a rel="nofollow" href="http://tournasdimitrios1.wordpress.com/2012/01/14/logging-visitors-ip-with-php/#comment-1046" target="_blank">http://tournasdimitrios1.wordpress.c.../#comment-1046</a><br />
<br />
<br />
However when I try and test this (see attachment) it does not function. <br />
PHP is enabled on the server as I have PHP feedback forms already running which are working fine. <br />
<br />
When I open the log file in notepadd++ it does not appear to highlight, i'm worried why its not recognising it as PHP. I double checked and wrote some PHP on a new page and it worked fine so i'm a bit confused as to what to do. Can anyone please help, i'm sure its something ridiculous i'm not seeing. <br />
<br />
Thank you for your time</div>


	<br />
	<div style="padding:6px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Files</legend>
			<table cellpadding="0" cellspacing="3" border="0">
			<tr>
	<td><img class="inlineimg" src="http://www.phpbuilder.com/board/images/attach/zip.gif" alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
	<td><a href="http://www.phpbuilder.com/board/attachment.php?attachmentid=4524&amp;d=1337251092">Test.zip</a> (1.0 KB)</td>
</tr>
			</table>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>swiss123</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384505</guid>
		</item>
		<item>
			<title>Decode eval(base64_decode)</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10384504&amp;goto=newpost</link>
			<pubDate>Thu, 17 May 2012 09:44:45 GMT</pubDate>
			<description><![CDATA[Hi

pleas decode 

<<removed by moderator>>]]></description>
			<content:encoded><![CDATA[<div>Hi<br />
<br />
pleas decode <br />
<br />
&lt;&lt;removed by moderator&gt;&gt;</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>koorosh2004</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10384504</guid>
		</item>
	</channel>
</rss>

