<?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>Sun, 22 Nov 2009 05:59:43 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.phpbuilder.com/board/images/misc/rss.jpg</url>
			<title>PHPBuilder.com</title>
			<link>http://www.phpbuilder.com/board</link>
		</image>
		<item>
			<title>Uploading files in database</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369710&amp;goto=newpost</link>
			<pubDate>Sun, 22 Nov 2009 05:52:52 GMT</pubDate>
			<description>Need help!...I wanted to create a simple document management system  and i want a  sample codes for uploading text files .pdf files,/ .doc files and etc.. directly to the database..and also viewing all files that already uploaded and ready for download...
Hope you can help me....
thank you...</description>
			<content:encoded><![CDATA[<div>Need help!...I wanted to create a simple document management system  and i want a  sample codes for uploading text files .pdf files,/ .doc files and etc.. directly to the database..and also viewing all files that already uploaded and ready for download...<br />
Hope you can help me....<br />
thank you...</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>belat</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369710</guid>
		</item>
		<item>
			<title>How to receive a ping</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369709&amp;goto=newpost</link>
			<pubDate>Sun, 22 Nov 2009 05:32:42 GMT</pubDate>
			<description>Looking for some guide, code examples, on how to receive a ping from a blog. Not sending, but receiving, so I know when the blog is updated.

Any pointers to some guides?</description>
			<content:encoded><![CDATA[<div>Looking for some guide, code examples, on how to receive a ping from a blog. Not sending, but receiving, so I know when the blog is updated.<br />
<br />
Any pointers to some guides?</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=2">General Help</category>
			<dc:creator>TheBeginner</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369709</guid>
		</item>
		<item>
			<title>Dynamic variable based on database record/recall - Help?</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369708&amp;goto=newpost</link>
			<pubDate>Sun, 22 Nov 2009 02:19:47 GMT</pubDate>
			<description><![CDATA[OK, ill keep this as short as I can..

I am trying to create a truly scalable environment for my users and so allow them to..
1. define a new option (dshop_options_name)
2. define option values (dshop_options_values)
separate tables in the database

this is to allow distinct values to be assigned and also in any combination.
ok, the script is in 2 parts. The form page and the result page

** form.php (using POST)

first I need to create dropdowns dynamically based on the options assigned to the product, and then run through the dshop_options_values table to get any values assigned to that option

//////////////////////////////////////////////////////////////////////////////////////////

$prod_prop_name=mysql_query("SELECT * FROM `dshop_options_name`");
	$prod_prop_name_array= array();
	while($data9=mysql_fetch_array($prod_prop_name)) {
	$prod_prop_name_array[]=$data9;
	}

	foreach($prod_prop_name_array as $rowNum => $data9) {
	$prod_prop_id=$data9[0];
	$prod_prop_title=$data9[1];
	
$prod_prop_attri=mysql_query("SELECT * FROM `dshop_options_values` WHERE `prod_id`='".$selected_product."' AND `attri_name`='".$prod_prop_title."' ORDER BY `attri_value` ASC ");
	$prod_prop_attri_array= array();
	while($data10=mysql_fetch_array($prod_prop_attri)) {
	$prod_prop_attri_array[]=$data10;
	}	
		if(!$prod_prop_attri_array){}
		else{
		echo"<div class='left'>";
		echo"$prod_prop_title\n";?>
        <select name='<? echo $prod_prop_title?>'>
        <option value="select">Select</option>
        <?php	
		foreach($prod_prop_attri_array as $rowNum => $data10){
		$itemname=$data10[2];
		$itemvalue=$data10[3];
		$itemprice=$data10[4];
		if($itemprice<="0"){
		echo"<option value='".$itemvalue."'>".$itemvalue."</option>\n";
		}
		else{
		echo"<option value='".$itemvalue."'>".$itemvalue."&nbsp;-&nbsp;".$currency_type.$itemprice."</option>\n";
		}		
		}
		echo"</select></br></br></div>";
		}
	}

//////////////////////////////////////////////////////////////////////////////////////////

ok, as you can see, I name the select the same as the option name, this is so I then use that name to again call the value in the next script.


** result.php

Ok, to reasemble the data posted, I again, do a few calls to get all the data 

//////////////////////////////////////////////////////////////////////////////////////////

$prod_prop_name=mysql_query("SELECT * FROM `dshop_options_name`");
	$prod_prop_name_array= array();
	while($data9=mysql_fetch_array($prod_prop_name)) {
	$prod_prop_name_array[]=$data9;
	}
	foreach($prod_prop_name_array as $rowNum => $data9){
	$option_id=$data9[0];
	$option_name=$data9[1];
	$varnval=$_REQUEST[$option_name];
//echo"$varnval";
	$results = array();
	
		if(!$varnval | $varnval=="select"){}
		else{
		$results[] = $option_name."-".$varnval;
		$optpricesum_query=mysql_query("SELECT * FROM `dshop_options_values` WHERE `attri_name`='".$option_name."' AND `attri_value`='".$varnval."'");
		$optpricesum_result=mysql_fetch_array($optpricesum_query);
		$optpricesum=$optpricesum_result[4];
		}
		if(!$varnval | $varnval=="select"){}
		else{
		for ($i=0;$i<=0;$i++){$options.=$results[$i]." | ";}
		}
	}

//////////////////////////////////////////////////////////////////////////////////////////

ok, down to the issue...

in the form.php, I am posting a value dynamically created, essentially by the admin user.

Lets say they created an option "Foo", and the values "foo1", "foo2", "foo3" (in the admin area)

form.php builds the selects by cross referencing the two tables, names the select and then populates it (nothing is pre-defined)

then the end user arrives at the form on the front end and on posting the form, they selected "foo3"

result.php at first has nothing to _REQUEST (remember we had nothing to define)  until it rebuilds the possible vaiables that could have been posted.
I then used the foreach to run through all the option names stored with the hope of then creating dynamic variables... 
$varnval=$_REQUEST[$option_name]; 

I then filter the names that have not been posted with..
if(!$varnval | $varnval=="select"){}

now...

Locally I get the value "foo3" no problem, but not on the web server. I then noticed that when using local php (Xampp) values dont even need to be defined $var=$_POST['var']; it will still work.... annoying when debugging!! BUT shows to apoint anyways, that the script will work.

I places an echo after the $varnval $_REQUEST, but nothing displays.

It seems to me that the $_REQUEST is not getting the variable, either because of the parse or because I have just missed something.

I have spent days working on this, trying many different ways but all threads lead nowhere.

Maybe I am trying the impossible, but I feel there has to be a way to create a set of variables from database records alone (NOT the other way around as most searches seem to produce)

This is my first post here, so i apologise if it is in the wrong place!

I thank you in advance for any help

Kelso]]></description>
			<content:encoded><![CDATA[<div>OK, ill keep this as short as I can..<br />
<br />
I am trying to create a truly scalable environment for my users and so allow them to..<br />
1. define a new option (dshop_options_name)<br />
2. define option values (dshop_options_values)<br />
separate tables in the database<br />
<br />
this is to allow distinct values to be assigned and also in any combination.<br />
ok, the script is in 2 parts. The form page and the result page<br />
<br />
** form.php (using POST)<br />
<br />
first I need to create dropdowns dynamically based on the options assigned to the product, and then run through the dshop_options_values table to get any values assigned to that option<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
$prod_prop_name=mysql_query(&quot;SELECT * FROM `dshop_options_name`&quot;);<br />
	$prod_prop_name_array= array();<br />
	while($data9=mysql_fetch_array($prod_prop_name)) {<br />
	$prod_prop_name_array[]=$data9;<br />
	}<br />
<br />
	foreach($prod_prop_name_array as $rowNum =&gt; $data9) {<br />
	$prod_prop_id=$data9[0];<br />
	$prod_prop_title=$data9[1];<br />
	<br />
$prod_prop_attri=mysql_query(&quot;SELECT * FROM `dshop_options_values` WHERE `prod_id`='&quot;.$selected_product.&quot;' AND `attri_name`='&quot;.$prod_prop_title.&quot;' ORDER BY `attri_value` ASC &quot;);<br />
	$prod_prop_attri_array= array();<br />
	while($data10=mysql_fetch_array($prod_prop_attri)) {<br />
	$prod_prop_attri_array[]=$data10;<br />
	}	<br />
		if(!$prod_prop_attri_array){}<br />
		else{<br />
		echo&quot;&lt;div class='left'&gt;&quot;;<br />
		echo&quot;$prod_prop_title\n&quot;;?&gt;<br />
        &lt;select name='&lt;? echo $prod_prop_title?&gt;'&gt;<br />
        &lt;option value=&quot;select&quot;&gt;Select&lt;/option&gt;<br />
        &lt;?php	<br />
		foreach($prod_prop_attri_array as $rowNum =&gt; $data10){<br />
		$itemname=$data10[2];<br />
		$itemvalue=$data10[3];<br />
		$itemprice=$data10[4];<br />
		if($itemprice&lt;=&quot;0&quot;){<br />
		echo&quot;&lt;option value='&quot;.$itemvalue.&quot;'&gt;&quot;.$itemvalue.&quot;&lt;/option&gt;\n&quot;;<br />
		}<br />
		else{<br />
		echo&quot;&lt;option value='&quot;.$itemvalue.&quot;'&gt;&quot;.$itemvalue.&quot;&amp;nbsp;-&amp;nbsp;&quot;.$currency_type.$itemprice.&quot;&lt;/option&gt;\n&quot;;<br />
		}		<br />
		}<br />
		echo&quot;&lt;/select&gt;&lt;/br&gt;&lt;/br&gt;&lt;/div&gt;&quot;;<br />
		}<br />
	}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
ok, as you can see, I name the select the same as the option name, this is so I then use that name to again call the value in the next script.<br />
<br />
<br />
** result.php<br />
<br />
Ok, to reasemble the data posted, I again, do a few calls to get all the data <br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
$prod_prop_name=mysql_query(&quot;SELECT * FROM `dshop_options_name`&quot;);<br />
	$prod_prop_name_array= array();<br />
	while($data9=mysql_fetch_array($prod_prop_name)) {<br />
	$prod_prop_name_array[]=$data9;<br />
	}<br />
	foreach($prod_prop_name_array as $rowNum =&gt; $data9){<br />
	$option_id=$data9[0];<br />
	$option_name=$data9[1];<br />
	$varnval=$_REQUEST[$option_name];<br />
//echo&quot;$varnval&quot;;<br />
	$results = array();<br />
	<br />
		if(!$varnval | $varnval==&quot;select&quot;){}<br />
		else{<br />
		$results[] = $option_name.&quot;-&quot;.$varnval;<br />
		$optpricesum_query=mysql_query(&quot;SELECT * FROM `dshop_options_values` WHERE `attri_name`='&quot;.$option_name.&quot;' AND `attri_value`='&quot;.$varnval.&quot;'&quot;);<br />
		$optpricesum_result=mysql_fetch_array($optpricesum_query);<br />
		$optpricesum=$optpricesum_result[4];<br />
		}<br />
		if(!$varnval | $varnval==&quot;select&quot;){}<br />
		else{<br />
		for ($i=0;$i&lt;=0;$i++){$options.=$results[$i].&quot; | &quot;;}<br />
		}<br />
	}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
ok, down to the issue...<br />
<br />
in the form.php, I am posting a value dynamically created, essentially by the admin user.<br />
<br />
Lets say they created an option &quot;Foo&quot;, and the values &quot;foo1&quot;, &quot;foo2&quot;, &quot;foo3&quot; (in the admin area)<br />
<br />
form.php builds the selects by cross referencing the two tables, names the select and then populates it (nothing is pre-defined)<br />
<br />
then the end user arrives at the form on the front end and on posting the form, they selected &quot;foo3&quot;<br />
<br />
result.php at first has nothing to _REQUEST (remember we had nothing to define)  until it rebuilds the possible vaiables that could have been posted.<br />
I then used the foreach to run through all the option names stored with the hope of then creating dynamic variables... <br />
$varnval=$_REQUEST[$option_name]; <br />
<br />
I then filter the names that have not been posted with..<br />
if(!$varnval | $varnval==&quot;select&quot;){}<br />
<br />
now...<br />
<br />
Locally I get the value &quot;foo3&quot; no problem, but not on the web server. I then noticed that when using local php (Xampp) values dont even need to be defined $var=$_POST['var']; it will still work.... annoying when debugging!! BUT shows to apoint anyways, that the script will work.<br />
<br />
I places an echo after the $varnval $_REQUEST, but nothing displays.<br />
<br />
It seems to me that the $_REQUEST is not getting the variable, either because of the parse or because I have just missed something.<br />
<br />
I have spent days working on this, trying many different ways but all threads lead nowhere.<br />
<br />
Maybe I am trying the impossible, but I feel there has to be a way to create a set of variables from database records alone (NOT the other way around as most searches seem to produce)<br />
<br />
This is my first post here, so i apologise if it is in the wrong place!<br />
<br />
I thank you in advance for any help<br />
<br />
Kelso</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=2">General Help</category>
			<dc:creator>kelsofield</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369708</guid>
		</item>
		<item>
			<title>Php link exporter</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369707&amp;goto=newpost</link>
			<pubDate>Sun, 22 Nov 2009 00:19:18 GMT</pubDate>
			<description><![CDATA[Hello...can anyone around here help me make this script...i saw it somewhere it should be simple...so..
I'm some sort of newbie in this...what i wanna make is a php script that will put an input field on the page for url of some forum page...like:
http://www.phpbuilder.com/board/newthread.php?do=newthread&f=10
and a button below it. When the button is pressed the script will search the source code of the page and export links that begins with "http://www.google.com/" (for example) and print it on the page one below the other...
Example:
[img]http://img265.imageshack.us/img265/2237/32881531.jpg[/img]

Please answer as quick as you can i really need this.

Thanks ;)]]></description>
			<content:encoded><![CDATA[<div>Hello...can anyone around here help me make this script...i saw it somewhere it should be simple...so..<br />
I'm some sort of newbie in this...what i wanna make is a php script that will put an input field on the page for url of some forum page...like:<br />
<a rel="nofollow" href="http://www.phpbuilder.com/board/newthread.php?do=newthread&amp;f=10" target="_blank">http://www.phpbuilder.com/board/newt...newthread&amp;f=10</a><br />
and a button below it. When the button is pressed the script will search the source code of the page and export links that begins with &quot;http://www.google.com/&quot; (for example) and print it on the page one below the other...<br />
Example:<br />
<a href="http://img265.imageshack.us/img265/2237/32881531.jpg" target="_blank">http://img265.imageshack.us/img265/2237/32881531.jpg</a><br />
<br />
Please answer as quick as you can i really need this.<br />
<br />
Thanks ;)</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>The_L</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369707</guid>
		</item>
		<item>
			<title>calculate total in simple shopping cart</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369706&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 22:30:19 GMT</pubDate>
			<description><![CDATA[Hi,

I'm doing a very simple shopping cart for my website and I'm quite rusty at PHP and have forgotten how to calculate the grand total in my shopping cart. I am able to calculate the subtotal in every row but now I need to get the total of all the rows put together. 

Basically I have a mysql database which records all the products added to a cart during a session. In my basket.php file, I retrieve all the products for this particular session using a database query as follows:

<?php
$result = mysql_query( "SELECT * FROM Shopping_sessions WHERE Session_id='$ses_id'", $db);
if (!$result) {
echo("<p>Error performing query1: " . mysql_error() . "</p>");
exit();
} 
?>
<table width="100%" cellpadding="3" cellspacing="0" bgcolor="#FAF9CF">
  <tr>
  <td height="30"><strong>Item</strong></td>
  <td width="120"><strong>Quantity</strong></td>
  <td width="80"><strong>Item Price</strong></td>
  <td width="80"><strong>Subtotal</strong></td>
  </tr>
  <?php
while($row = mysql_fetch_array($result)){
$Product_quantity = $row["Quantity"];
$Product_id = $row["Product_id"];
$result2 = mysql_query( "SELECT * FROM Products WHERE Product_id=$Product_id", $db);
if (!$result2) {
echo("<p>Error performing query1: " . mysql_error() . "</p>");
exit();
} // query
$row2 = mysql_fetch_array($result2);
$Product_name = $row2["Product_name"];
$Product_price = $row2["Product_price"];
$total1 = $Product_quantity * $Product_price;
$total2 = number_format($total1, 2);
echo "<tr>    <td>$Product_name</td>
    <td>$Product_quantity</td>
    <td>$Product_price</td>
    <td>$total2</td>
  </tr>";
  }
?>

*// SO FAR SO GOOD, HERE IS WHERE I NEED HELP*
  
How do I calculate the combined value of $total2?]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I'm doing a very simple shopping cart for my website and I'm quite rusty at PHP and have forgotten how to calculate the grand total in my shopping cart. I am able to calculate the subtotal in every row but now I need to get the total of all the rows put together. <br />
<br />
Basically I have a mysql database which records all the products added to a cart during a session. In my basket.php file, I retrieve all the products for this particular session using a database query as follows:<br />
<br />
&lt;?php<br />
$result = mysql_query( &quot;SELECT * FROM Shopping_sessions WHERE Session_id='$ses_id'&quot;, $db);<br />
if (!$result) {<br />
echo(&quot;&lt;p&gt;Error performing query1: &quot; . mysql_error() . &quot;&lt;/p&gt;&quot;);<br />
exit();<br />
} <br />
?&gt;<br />
&lt;table width=&quot;100%&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#FAF9CF&quot;&gt;<br />
  &lt;tr&gt;<br />
  &lt;td height=&quot;30&quot;&gt;&lt;strong&gt;Item&lt;/strong&gt;&lt;/td&gt;<br />
  &lt;td width=&quot;120&quot;&gt;&lt;strong&gt;Quantity&lt;/strong&gt;&lt;/td&gt;<br />
  &lt;td width=&quot;80&quot;&gt;&lt;strong&gt;Item Price&lt;/strong&gt;&lt;/td&gt;<br />
  &lt;td width=&quot;80&quot;&gt;&lt;strong&gt;Subtotal&lt;/strong&gt;&lt;/td&gt;<br />
  &lt;/tr&gt;<br />
  &lt;?php<br />
while($row = mysql_fetch_array($result)){<br />
$Product_quantity = $row[&quot;Quantity&quot;];<br />
$Product_id = $row[&quot;Product_id&quot;];<br />
$result2 = mysql_query( &quot;SELECT * FROM Products WHERE Product_id=$Product_id&quot;, $db);<br />
if (!$result2) {<br />
echo(&quot;&lt;p&gt;Error performing query1: &quot; . mysql_error() . &quot;&lt;/p&gt;&quot;);<br />
exit();<br />
} // query<br />
$row2 = mysql_fetch_array($result2);<br />
$Product_name = $row2[&quot;Product_name&quot;];<br />
$Product_price = $row2[&quot;Product_price&quot;];<br />
$total1 = $Product_quantity * $Product_price;<br />
$total2 = number_format($total1, 2);<br />
echo &quot;&lt;tr&gt;    &lt;td&gt;$Product_name&lt;/td&gt;<br />
    &lt;td&gt;$Product_quantity&lt;/td&gt;<br />
    &lt;td&gt;$Product_price&lt;/td&gt;<br />
    &lt;td&gt;$total2&lt;/td&gt;<br />
  &lt;/tr&gt;&quot;;<br />
  }<br />
?&gt;<br />
<br />
<b>// SO FAR SO GOOD, HERE IS WHERE I NEED HELP</b><br />
  <br />
How do I calculate the combined value of $total2?</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>mayandy</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369706</guid>
		</item>
		<item>
			<title>PhP Mysql query blog latest results</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369704&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 19:52:27 GMT</pubDate>
			<description>Hi guys,
I need your help. I have a blog and on a complete different page my homepage. Now what I want to do is that if I post a new post on my blog that the first 35 words  of it appear in a layer, and then as well next to it the publish date. 
I realized that I would need to create an mysql query which comes up with the last entry,
How can I do that? And then which is probably more complicated how can I tell mysql to give me just 35 words, or can I limit in any way the layer????
I am helpless! I would deeply appreciate if someone could help me!
Thanks!</description>
			<content:encoded><![CDATA[<div>Hi guys,<br />
I need your help. I have a blog and on a complete different page my homepage. Now what I want to do is that if I post a new post on my blog that the first 35 words  of it appear in a layer, and then as well next to it the publish date. <br />
I realized that I would need to create an mysql query which comes up with the last entry,<br />
How can I do that? And then which is probably more complicated how can I tell mysql to give me just 35 words, or can I limit in any way the layer????<br />
I am helpless! I would deeply appreciate if someone could help me!<br />
Thanks!</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>gwolff2005</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369704</guid>
		</item>
		<item>
			<title>Problems with Function + SQL</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369701&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 13:35:38 GMT</pubDate>
			<description><![CDATA[Hey All,

Im having a problem with a query and function im writing.

I have 2 database tables.

The first one, lets call it scores, has the columns email, correct, time, stamp and month

the second table, which is called users, has email, dispname, country

example of the first table
----------------------------------------------
| email | correct | time | stamp | month |
| test@test.com | 3 | 2 | 12345678 | 11 |
| test@test.com | 6 | 12 | 12345678 | 11 |
| testing@testing.com | 12 | 30 | 12345678 | 11 |
| testing@testing.com | 122 | 10 | 12345678 | 11 |
---------------------------------------------------------

So what i need to do is extract all the rows with the same email address and the same month, then add the correct fields and the time fields together so i am left with the following result
----------------------------------------------
| email | correct | time | stamp | month |
| test@test.com | 9 | 4 | 12345678 | 11 |
| testing@testing.com | 134 | 40 | 12345678 | 11 |
---------------------------------------------------------

and so on for every email address that happens to be inserted into the scores table.

Once that that has been completed, i need to find the top 10 people with the highest "correct" score and with the lowest "time" score, so they are ranked according to their score and time.

Once the top 10 have been found, i then need to search the 'users' table to find the dispname and country of each of the outputted top 10 users.

and finally i need to display the top 10 as:

rank - dispname - country - correct - time

If anyone could help me out .... i would be so greatful ... its doing my head in something bad hahah

Thanks]]></description>
			<content:encoded><![CDATA[<div>Hey All,<br />
<br />
Im having a problem with a query and function im writing.<br />
<br />
I have 2 database tables.<br />
<br />
The first one, lets call it scores, has the columns email, correct, time, stamp and month<br />
<br />
the second table, which is called users, has email, dispname, country<br />
<br />
example of the first table<br />
----------------------------------------------<br />
| email | correct | time | stamp | month |<br />
| <a href="mailto:test@test.com">test@test.com</a> | 3 | 2 | 12345678 | 11 |<br />
| <a href="mailto:test@test.com">test@test.com</a> | 6 | 12 | 12345678 | 11 |<br />
| <a href="mailto:testing@testing.com">testing@testing.com</a> | 12 | 30 | 12345678 | 11 |<br />
| <a href="mailto:testing@testing.com">testing@testing.com</a> | 122 | 10 | 12345678 | 11 |<br />
---------------------------------------------------------<br />
<br />
So what i need to do is extract all the rows with the same email address and the same month, then add the correct fields and the time fields together so i am left with the following result<br />
----------------------------------------------<br />
| email | correct | time | stamp | month |<br />
| <a href="mailto:test@test.com">test@test.com</a> | 9 | 4 | 12345678 | 11 |<br />
| <a href="mailto:testing@testing.com">testing@testing.com</a> | 134 | 40 | 12345678 | 11 |<br />
---------------------------------------------------------<br />
<br />
and so on for every email address that happens to be inserted into the scores table.<br />
<br />
Once that that has been completed, i need to find the top 10 people with the highest &quot;correct&quot; score and with the lowest &quot;time&quot; score, so they are ranked according to their score and time.<br />
<br />
Once the top 10 have been found, i then need to search the 'users' table to find the dispname and country of each of the outputted top 10 users.<br />
<br />
and finally i need to display the top 10 as:<br />
<br />
rank - dispname - country - correct - time<br />
<br />
If anyone could help me out .... i would be so greatful ... its doing my head in something bad hahah<br />
<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=6">Database</category>
			<dc:creator>intervelopment</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369701</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] remove values from string]]></title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369700&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 13:21:42 GMT</pubDate>
			<description>I have a string of numeric ids in a comma separated format


PHP:
---------
$IDs = 23,34,55,42,33,41,22 ... 6767,4556;
---------
I also have a table that may have some values that should be removed from the string of IDs. How do I do that?</description>
			<content:encoded><![CDATA[<div>I have a string of numeric ids in a comma separated format<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">$IDs </font><font color="#007700">= </font><font color="#0000BB">23</font><font color="#007700">,</font><font color="#0000BB">34</font><font color="#007700">,</font><font color="#0000BB">55</font><font color="#007700">,</font><font color="#0000BB">42</font><font color="#007700">,</font><font color="#0000BB">33</font><font color="#007700">,</font><font color="#0000BB">41</font><font color="#007700">,</font><font color="#0000BB">22 </font><font color="#007700">... </font><font color="#0000BB">6767</font><font color="#007700">,</font><font color="#0000BB">4556</font><font color="#007700">; <br /></font><font color="#0000BB"></font>
</font>
</code><!-- php buffer end -->
		</div>
		</code>
		<hr />
	</div>
</div>I also have a table that may have some values that should be removed from the string of IDs. How do I do that?</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>zzz</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369700</guid>
		</item>
		<item>
			<title>register_globals</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369699&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 12:36:40 GMT</pubDate>
			<description><![CDATA[my old scripts which were designed for me about 4 years ago required registered_globals to be on. 

I never knew this but in October my host got rid of this feature and my scripts do not work. It won't allow me to have a .htaccess file, but i can have a php.ini file

my host is Yahoo.

This only needs to be temp as all new scripts are in the works and should be done soon.

any help on what i might need to make this work is appriciated]]></description>
			<content:encoded><![CDATA[<div>my old scripts which were designed for me about 4 years ago required registered_globals to be on. <br />
<br />
I never knew this but in October my host got rid of this feature and my scripts do not work. It won't allow me to have a .htaccess file, but i can have a php.ini file<br />
<br />
my host is Yahoo.<br />
<br />
This only needs to be temp as all new scripts are in the works and should be done soon.<br />
<br />
any help on what i might need to make this work is appriciated</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=2">General Help</category>
			<dc:creator>msnhockey</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369699</guid>
		</item>
		<item>
			<title>Can someone modify this easy code please</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369698&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 11:11:20 GMT</pubDate>
			<description><![CDATA[<?php $links = array
( 
'<a href="link1" />HERE</a>',
'<a href="link2" />HERE</a>',
'<a href="link3" />HERE</a>',
'<a href="link4" />HERE</a>',
'<a href="link5" />HERE</a>',
'<a href="link6" />HERE</a>',
); 

$max = count($links)-1;
$rand = rand(0, $max);
?>

<?print $links[$rand];?>

I need it to go in order from top down, then start again. Not random like it is.

Thanks.]]></description>
			<content:encoded><![CDATA[<div>&lt;?php $links = array<br />
( <br />
'&lt;a href=&quot;link1&quot; /&gt;HERE&lt;/a&gt;',<br />
'&lt;a href=&quot;link2&quot; /&gt;HERE&lt;/a&gt;',<br />
'&lt;a href=&quot;link3&quot; /&gt;HERE&lt;/a&gt;',<br />
'&lt;a href=&quot;link4&quot; /&gt;HERE&lt;/a&gt;',<br />
'&lt;a href=&quot;link5&quot; /&gt;HERE&lt;/a&gt;',<br />
'&lt;a href=&quot;link6&quot; /&gt;HERE&lt;/a&gt;',<br />
); <br />
<br />
$max = count($links)-1;<br />
$rand = rand(0, $max);<br />
?&gt;<br />
<br />
&lt;?print $links[$rand];?&gt;<br />
<br />
I need it to go in order from top down, then start again. Not random like it is.<br />
<br />
Thanks.</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>TwistedLogix</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369698</guid>
		</item>
		<item>
			<title>Mail functionality from localhost to server</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369697&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 08:43:32 GMT</pubDate>
			<description><![CDATA[Hi 

I am facing problem of mail functionality.

When i tested mail functionality in my localhost it works fine but when i tried it on server it didn't work and also no error it displays.

So please give me solution if any changes required to setting mail functionality on server from local.

Thanks in advance

Anish Panchal
Software Outsourcing India (http://www.tatvasoft.com)
Web Development Company India (http://www.sparsh-technologies.com)]]></description>
			<content:encoded><![CDATA[<div>Hi <br />
<br />
I am facing problem of mail functionality.<br />
<br />
When i tested mail functionality in my localhost it works fine but when i tried it on server it didn't work and also no error it displays.<br />
<br />
So please give me solution if any changes required to setting mail functionality on server from local.<br />
<br />
Thanks in advance<br />
<br />
Anish Panchal<br />
<a rel="nofollow" href="http://www.tatvasoft.com" target="_blank">Software Outsourcing India</a><br />
<a rel="nofollow" href="http://www.sparsh-technologies.com" target="_blank">Web Development Company India</a></div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=2">General Help</category>
			<dc:creator>asparsh</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369697</guid>
		</item>
		<item>
			<title>youtube integration</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369696&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 05:38:17 GMT</pubDate>
			<description><![CDATA[A friend of mine coded this but it suddenly stopped working.

After placing the youtube URL into the field, it displays the error, "The video details cannot be retrieved.". We like that the error detection works but why did it break?


Code:
---------
<?php
include('application.php');
if ($myID == 0) goto('login.php');
_v('e;i:eid');

if ($mode == 'e')
{
   $main .= "<center><br><br>
      The video cannot be found. <br> <br> <br>
      <input type='button' name='b1' class='bttn' value='< Go Back' onclick=\"location.replace('myvideos.php');\">
    </center>";
}

if ($mode == 'delete')
{
   $qc = mysql_query("SELECT * FROM `video` WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID'");
   if (mysql_num_rows($qc) == 0) goto('myvideos.php');
   $rc = mysql_fetch_assoc($qc);
   extract($rc);
   if ($vid_thumb != '') @unlink("$base_path/photo/video/$vid_thumb");
   $qd = mysql_query("DELETE FROM `video` WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID' LIMIT 1");
   goto('myvideos.php');
}

// Add From Youtube

if ($mode == 'addys')
{
   _v('ttl,dsc,ytc,tags,thumb,v__id,catid');
   $now = date('Y-m-d H:i:s');
   $url = gen_url($ttl, 60, 'video', 'vid_url');
   $fname = '';

   if ($m_ytc != '') $hcode = $m_ytc;
   else $hcode = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'.$v__id.'&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$v__id.'&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
   $tags = make_tags($tags, ' ');

   $qins = mysql_query("INSERT INTO `video`
     (`vid_useid`, `vid_catid`, `vid_title`, `vid_url`, `vid_desc`, `vid_code`, `vid_date`, `vid_enabled`, `vid_tags`, `vid_thumb`) VALUES 
     ('$myID', '$catid', '$m_ttl', '$url', '$m_dsc', '$hcode', '$now', '1', '$tags', '$fname')") or die(mysql_error());
   $last = mysql_insert_id();

   $yfile = "http://i2.ytimg.com/vi/$v__id/default.jpg";
   $fname = 'vt'.$last.'.'.'jpg';
   $thumb = new thumb($yfile, 'jpg', "photo/video/$fname");
   $thumb -> fixed(120, 90);
   if (!file_exists("photo/video/$fname")) $fname = '';
   $qupd = mysql_query("UPDATE `video` SET `vid_thumb` = '$fname' WHERE `vid_id` = '$last'");
   goto('myvideos.php');
}

if ($mode == 'adda')
{
   _v('vurl');
   $info = get_youtube_info($vurl);
   if ($info['error'] != '') { $mode = 'addy';  $e = 1; }
   else
   {
      extract($info);
      $cj = new jsValid('frmab');
      $cj->addf('ttl,catid');
      $js = $cj->show(1, 0);
      $main .= "<form action='myvideos.php' method='post' name='frmab' id='frmab' style='margin:0px' enctype='multipart/form-data'><input type='hidden' name='mode' value='addys'><input type='hidden' name='thumb' value='$thumb'><input type='hidden' name='v__id' value='$v__id'>
         <table border='0' cellspacing='2' cellpadding='3' align='center' width='400'>
          <tr><td><b>Title</b>:<br><input type='text' name='ttl' value=\"$title\" class='input' style='width:340px'></td></tr>
          <tr><td><br><b>Category</b>:<br>".sel_db('catid', 'category', 'cat_id', 'cat_name', "`cat_type` = 'videos'", '', '- Select -', 'input', '', '238')."</td></tr>
          <tr><td><b>Description</b>:<br><textarea name='dsc' class='input' style='width:340px;height:100px'>$desc</textarea></td></tr>
          <tr><td><b>Tags</b>: <br><input type='text' name='tags' value=\"$tags\" class='input' style='width:340px'></td></tr>
          <tr><td align='center'><br><input type='submit' name='sub' class='bttn' value='Add Video'> &nbsp; &nbsp; <input type='button' name='cnc' class='bttn' value='Cancel' onclick=\"location.replace('myvideos.php');\"></td></tr>
         </table></form>$js";
   }
}

if ($mode == 'edits')
{
   _v('ttl,catid,dsc,tags');
   $tags = make_tags($m_tags, ' ');
   $qupd = mysql_query("UPDATE `video` SET `vid_catid` = '$m_catid', `vid_title` = '$m_ttl', `vid_desc` = '$m_dsc', `vid_tags` = '$tags' WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID'");
   goto("$base_url/myvideos.php");
}

if ($mode == 'edit')
{
   $qv = mysql_query("SELECT * FROM `video` WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID'");
   if (mysql_num_rows($qv) == 0) goto("$base_url/myvideos.php");
   $rv = mysql_fetch_assoc($qv);
   extract($rv);
   $tags = unmake_tags($vid_tags, ',');
   
   $cj = new jsValid('frmab');
   $cj->addf('ttl,catid');
   $js = $cj->show(1, 0);
   $main .= tab('Edit Video', 600);
   $main .= "<form action='myvideos.php' method='post' name='frmab' id='frmab' style='margin:0px' enctype='multipart/form-data'><input type='hidden' name='mode' value='edits'><input type='hidden' name='eid' value='$eid'>
       <table border='0' cellspacing='2' cellpadding='3' align='center' width='400'>
        <tr><td><b>Title</b>:<br><input type='text' name='ttl' value=\"$vid_title\" class='input' style='width:340px'></td></tr>
        <tr><td><br><b>Category</b>:<br>".sel_db('catid', 'category', 'cat_id', 'cat_name', "`cat_type` = 'videos'", $vid_catid, '', 'input', '', '238')."</td></tr>
        <tr><td><b><br>Description</b>:<br><textarea name='dsc' class='input' style='width:340px;height:100px'>$vid_desc</textarea></td></tr>
        <tr><td><b>Tags</b>: <br><input type='text' name='tags' value=\"$tags\" class='input' style='width:340px'></td></tr>
        <tr><td align='center'><br><input type='submit' name='sub' class='bttn' value='Update'> &nbsp; &nbsp; <input type='button' name='cnc' class='bttn' value='Cancel' onclick=\"location.replace('myvideos.php');\"></td></tr>
       </table></form>$js";
   $main .= tabe();
}


if ($mode == 'addy')
{
   $main = "
     <form action='myvideos.php' method='post' name='frmab' id='frmab' style='margin:0px' enctype='multipart/form-data'>
     <input type='hidden' name='mode' value='adda'>
     <center><br>
     Please enter the YOUTUBE URL of the video <br>
     <i>eq: http://www.youtube.com/watch?v=B5i3mQhtNtg</i><br><br>
       <input type='text' name='vurl' class='input' style='width:300px'><br><br>
       <input type='submit' name='sub' class='bttn' value='Continue >'> &nbsp; &nbsp;
       <input type='button' name='cnc' class='bttn' value='Cancel' onclick=\"location.replace('myvideos.php')\">
   </center>";
   if ($e == 1) $main .= "<center><font color='red'>The video details cannot be retrieved.</font>";
}


if ($mode == '')
{
   $main .= tab2('My Videos', "<input type='button' name='b1' class='bttn' value='Add Youtube Video' onclick=\"location.replace('$base_url/myvideos.php?mode=addy');\">", 650);
   $main .= "<div style='margin:10px'>";
   $qe = mysql_query("SELECT * FROM `video` WHERE `vid_useid` = '$myID' ORDER BY `vid_id` DESC");
   if (mysql_num_rows($qe) == 0) $main .= "<center><br>You have not added any videos yet.</center>";
   else
   {
      $main .= "<table border='0' cellspacing='4' cellpadding='3' width='600' align='center'>";
      while ($re = mysql_fetch_assoc($qe))
      {
         extract($re);
         $thumb = '&nbsp;';
         if ($vid_thumb != '') $thumb = "<img src='photo/video/$vid_thumb' border='0'>";
         $vid_desc = mktext($vid_desc, 250);
         $vlink = URL::video($vid_id, $vid_url);
         $main .= "
             <tr>
              <td width='140' valign='top'><a href='$vlink'>$thumb</a></td>
              <td width='460' valign='top'>
                <a class='evtt' href='$vlink'>$vid_title</a>
                <div style='margin-top:5px;line-height:17px'>$vid_desc</div>
                <div style='margin-top:3px;color:#555555;line-height:19px'>
                     <a href='myvideos.php?mode=edit&eid=$vid_id'>Edit Video</a> &nbsp;
                     <a href='#' onclick=\"if (confirm('Are you sure you want to delete this video?')==true) location.replace('myvideos.php?mode=delete&eid=$vid_id');\">Delete Video</a></div>
              </td>
             </tr><tr><td colspan='2'><div style='border-top:1px solid #C7C7C7;height:2px;margin-top:4px;'>&nbsp;</div></td></tr>";
      }
      $main .= "</table>";
   }
   $main .= "<center><br><br>
       <input type='button' name='b1' class='bttn' value='Add Youtube Video' onclick=\"location.replace('$base_url/myvideos.php?mode=addy');\"> &nbsp; &nbsp;        
     </center></div>";
   $main .= tabe();
   $main .= "<div style='line-height:19px;margin-left:20px;margin-bottom:20px'>Easily import your favorite YouTube videos and share them with members. No uploading required. <br /> <a href='".URL::page('faq')."'>Support</a> </div>";
}

$_vtemplate['main'] = $main;
$_vtemplate['right'] = $right;
$tp = new page($_vtemplate, 'template/default2.html');
---------
]]></description>
			<content:encoded><![CDATA[<div>A friend of mine coded this but it suddenly stopped working.<br />
<br />
After placing the youtube URL into the field, it displays the error, &quot;The video details cannot be retrieved.&quot;. We like that the error detection works but why did it break?<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;?php<br />
include('application.php');<br />
if ($myID == 0) goto('login.php');<br />
_v('e;i:eid');<br />
<br />
if ($mode == 'e')<br />
{<br />
&nbsp;  $main .= &quot;&lt;center&gt;&lt;br&gt;&lt;br&gt;<br />
&nbsp; &nbsp; &nbsp; The video cannot be found. &lt;br&gt; &lt;br&gt; &lt;br&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;input type='button' name='b1' class='bttn' value='&lt; Go Back' onclick=\&quot;location.replace('myvideos.php');\&quot;&gt;<br />
&nbsp; &nbsp; &lt;/center&gt;&quot;;<br />
}<br />
<br />
if ($mode == 'delete')<br />
{<br />
&nbsp;  $qc = mysql_query(&quot;SELECT * FROM `video` WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID'&quot;);<br />
&nbsp;  if (mysql_num_rows($qc) == 0) goto('myvideos.php');<br />
&nbsp;  $rc = mysql_fetch_assoc($qc);<br />
&nbsp;  extract($rc);<br />
&nbsp;  if ($vid_thumb != '') @unlink(&quot;$base_path/photo/video/$vid_thumb&quot;);<br />
&nbsp;  $qd = mysql_query(&quot;DELETE FROM `video` WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID' LIMIT 1&quot;);<br />
&nbsp;  goto('myvideos.php');<br />
}<br />
<br />
// Add From Youtube<br />
<br />
if ($mode == 'addys')<br />
{<br />
&nbsp;  _v('ttl,dsc,ytc,tags,thumb,v__id,catid');<br />
&nbsp;  $now = date('Y-m-d H:i:s');<br />
&nbsp;  $url = gen_url($ttl, 60, 'video', 'vid_url');<br />
&nbsp;  $fname = '';<br />
<br />
&nbsp;  if ($m_ytc != '') $hcode = $m_ytc;<br />
&nbsp;  else $hcode = '&lt;object width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/'.$v__id.'&amp;hl=en&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/'.$v__id.'&amp;hl=en&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;';<br />
&nbsp;  $tags = make_tags($tags, ' ');<br />
<br />
&nbsp;  $qins = mysql_query(&quot;INSERT INTO `video`<br />
&nbsp; &nbsp;  (`vid_useid`, `vid_catid`, `vid_title`, `vid_url`, `vid_desc`, `vid_code`, `vid_date`, `vid_enabled`, `vid_tags`, `vid_thumb`) VALUES <br />
&nbsp; &nbsp;  ('$myID', '$catid', '$m_ttl', '$url', '$m_dsc', '$hcode', '$now', '1', '$tags', '$fname')&quot;) or die(mysql_error());<br />
&nbsp;  $last = mysql_insert_id();<br />
<br />
&nbsp;  $yfile = &quot;http://i2.ytimg.com/vi/$v__id/default.jpg&quot;;<br />
&nbsp;  $fname = 'vt'.$last.'.'.'jpg';<br />
&nbsp;  $thumb = new thumb($yfile, 'jpg', &quot;photo/video/$fname&quot;);<br />
&nbsp;  $thumb -&gt; fixed(120, 90);<br />
&nbsp;  if (!file_exists(&quot;photo/video/$fname&quot;)) $fname = '';<br />
&nbsp;  $qupd = mysql_query(&quot;UPDATE `video` SET `vid_thumb` = '$fname' WHERE `vid_id` = '$last'&quot;);<br />
&nbsp;  goto('myvideos.php');<br />
}<br />
<br />
if ($mode == 'adda')<br />
{<br />
&nbsp;  _v('vurl');<br />
&nbsp;  $info = get_youtube_info($vurl);<br />
&nbsp;  if ($info['error'] != '') { $mode = 'addy';&nbsp; $e = 1; }<br />
&nbsp;  else<br />
&nbsp;  {<br />
&nbsp; &nbsp; &nbsp; extract($info);<br />
&nbsp; &nbsp; &nbsp; $cj = new jsValid('frmab');<br />
&nbsp; &nbsp; &nbsp; $cj-&gt;addf('ttl,catid');<br />
&nbsp; &nbsp; &nbsp; $js = $cj-&gt;show(1, 0);<br />
&nbsp; &nbsp; &nbsp; $main .= &quot;&lt;form action='myvideos.php' method='post' name='frmab' id='frmab' style='margin:0px' enctype='multipart/form-data'&gt;&lt;input type='hidden' name='mode' value='addys'&gt;&lt;input type='hidden' name='thumb' value='$thumb'&gt;&lt;input type='hidden' name='v__id' value='$v__id'&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  &lt;table border='0' cellspacing='2' cellpadding='3' align='center' width='400'&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;:&lt;br&gt;&lt;input type='text' name='ttl' value=\&quot;$title\&quot; class='input' style='width:340px'&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;b&gt;Category&lt;/b&gt;:&lt;br&gt;&quot;.sel_db('catid', 'category', 'cat_id', 'cat_name', &quot;`cat_type` = 'videos'&quot;, '', '- Select -', 'input', '', '238').&quot;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Description&lt;/b&gt;:&lt;br&gt;&lt;textarea name='dsc' class='input' style='width:340px;height:100px'&gt;$desc&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Tags&lt;/b&gt;: &lt;br&gt;&lt;input type='text' name='tags' value=\&quot;$tags\&quot; class='input' style='width:340px'&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td align='center'&gt;&lt;br&gt;&lt;input type='submit' name='sub' class='bttn' value='Add Video'&gt; &amp;nbsp; &amp;nbsp; &lt;input type='button' name='cnc' class='bttn' value='Cancel' onclick=\&quot;location.replace('myvideos.php');\&quot;&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  &lt;/table&gt;&lt;/form&gt;$js&quot;;<br />
&nbsp;  }<br />
}<br />
<br />
if ($mode == 'edits')<br />
{<br />
&nbsp;  _v('ttl,catid,dsc,tags');<br />
&nbsp;  $tags = make_tags($m_tags, ' ');<br />
&nbsp;  $qupd = mysql_query(&quot;UPDATE `video` SET `vid_catid` = '$m_catid', `vid_title` = '$m_ttl', `vid_desc` = '$m_dsc', `vid_tags` = '$tags' WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID'&quot;);<br />
&nbsp;  goto(&quot;$base_url/myvideos.php&quot;);<br />
}<br />
<br />
if ($mode == 'edit')<br />
{<br />
&nbsp;  $qv = mysql_query(&quot;SELECT * FROM `video` WHERE `vid_id` = '$eid' AND `vid_useid` = '$myID'&quot;);<br />
&nbsp;  if (mysql_num_rows($qv) == 0) goto(&quot;$base_url/myvideos.php&quot;);<br />
&nbsp;  $rv = mysql_fetch_assoc($qv);<br />
&nbsp;  extract($rv);<br />
&nbsp;  $tags = unmake_tags($vid_tags, ',');<br />
&nbsp;  <br />
&nbsp;  $cj = new jsValid('frmab');<br />
&nbsp;  $cj-&gt;addf('ttl,catid');<br />
&nbsp;  $js = $cj-&gt;show(1, 0);<br />
&nbsp;  $main .= tab('Edit Video', 600);<br />
&nbsp;  $main .= &quot;&lt;form action='myvideos.php' method='post' name='frmab' id='frmab' style='margin:0px' enctype='multipart/form-data'&gt;&lt;input type='hidden' name='mode' value='edits'&gt;&lt;input type='hidden' name='eid' value='$eid'&gt;<br />
&nbsp; &nbsp; &nbsp;  &lt;table border='0' cellspacing='2' cellpadding='3' align='center' width='400'&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;:&lt;br&gt;&lt;input type='text' name='ttl' value=\&quot;$vid_title\&quot; class='input' style='width:340px'&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;br&gt;&lt;b&gt;Category&lt;/b&gt;:&lt;br&gt;&quot;.sel_db('catid', 'category', 'cat_id', 'cat_name', &quot;`cat_type` = 'videos'&quot;, $vid_catid, '', 'input', '', '238').&quot;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;br&gt;Description&lt;/b&gt;:&lt;br&gt;&lt;textarea name='dsc' class='input' style='width:340px;height:100px'&gt;$vid_desc&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Tags&lt;/b&gt;: &lt;br&gt;&lt;input type='text' name='tags' value=\&quot;$tags\&quot; class='input' style='width:340px'&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td align='center'&gt;&lt;br&gt;&lt;input type='submit' name='sub' class='bttn' value='Update'&gt; &amp;nbsp; &amp;nbsp; &lt;input type='button' name='cnc' class='bttn' value='Cancel' onclick=\&quot;location.replace('myvideos.php');\&quot;&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp;  &lt;/table&gt;&lt;/form&gt;$js&quot;;<br />
&nbsp;  $main .= tabe();<br />
}<br />
<br />
<br />
if ($mode == 'addy')<br />
{<br />
&nbsp;  $main = &quot;<br />
&nbsp; &nbsp;  &lt;form action='myvideos.php' method='post' name='frmab' id='frmab' style='margin:0px' enctype='multipart/form-data'&gt;<br />
&nbsp; &nbsp;  &lt;input type='hidden' name='mode' value='adda'&gt;<br />
&nbsp; &nbsp;  &lt;center&gt;&lt;br&gt;<br />
&nbsp; &nbsp;  Please enter the YOUTUBE URL of the video &lt;br&gt;<br />
&nbsp; &nbsp;  &lt;i&gt;eq: http://www.youtube.com/watch?v=B5i3mQhtNtg&lt;/i&gt;&lt;br&gt;&lt;br&gt;<br />
&nbsp; &nbsp; &nbsp;  &lt;input type='text' name='vurl' class='input' style='width:300px'&gt;&lt;br&gt;&lt;br&gt;<br />
&nbsp; &nbsp; &nbsp;  &lt;input type='submit' name='sub' class='bttn' value='Continue &gt;'&gt; &amp;nbsp; &amp;nbsp;<br />
&nbsp; &nbsp; &nbsp;  &lt;input type='button' name='cnc' class='bttn' value='Cancel' onclick=\&quot;location.replace('myvideos.php')\&quot;&gt;<br />
&nbsp;  &lt;/center&gt;&quot;;<br />
&nbsp;  if ($e == 1) $main .= &quot;&lt;center&gt;&lt;font color='red'&gt;The video details cannot be retrieved.&lt;/font&gt;&quot;;<br />
}<br />
<br />
<br />
if ($mode == '')<br />
{<br />
&nbsp;  $main .= tab2('My Videos', &quot;&lt;input type='button' name='b1' class='bttn' value='Add Youtube Video' onclick=\&quot;location.replace('$base_url/myvideos.php?mode=addy');\&quot;&gt;&quot;, 650);<br />
&nbsp;  $main .= &quot;&lt;div style='margin:10px'&gt;&quot;;<br />
&nbsp;  $qe = mysql_query(&quot;SELECT * FROM `video` WHERE `vid_useid` = '$myID' ORDER BY `vid_id` DESC&quot;);<br />
&nbsp;  if (mysql_num_rows($qe) == 0) $main .= &quot;&lt;center&gt;&lt;br&gt;You have not added any videos yet.&lt;/center&gt;&quot;;<br />
&nbsp;  else<br />
&nbsp;  {<br />
&nbsp; &nbsp; &nbsp; $main .= &quot;&lt;table border='0' cellspacing='4' cellpadding='3' width='600' align='center'&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; while ($re = mysql_fetch_assoc($qe))<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp;  extract($re);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  $thumb = '&amp;nbsp;';<br />
&nbsp; &nbsp; &nbsp; &nbsp;  if ($vid_thumb != '') $thumb = &quot;&lt;img src='photo/video/$vid_thumb' border='0'&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  $vid_desc = mktext($vid_desc, 250);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  $vlink = URL::video($vid_id, $vid_url);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  $main .= &quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width='140' valign='top'&gt;&lt;a href='$vlink'&gt;$thumb&lt;/a&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width='460' valign='top'&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a class='evtt' href='$vlink'&gt;$vid_title&lt;/a&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div style='margin-top:5px;line-height:17px'&gt;$vid_desc&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div style='margin-top:3px;color:#555555;line-height:19px'&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;a href='myvideos.php?mode=edit&amp;eid=$vid_id'&gt;Edit Video&lt;/a&gt; &amp;nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;a href='#' onclick=\&quot;if (confirm('Are you sure you want to delete this video?')==true) location.replace('myvideos.php?mode=delete&amp;eid=$vid_id');\&quot;&gt;Delete Video&lt;/a&gt;&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2'&gt;&lt;div style='border-top:1px solid #C7C7C7;height:2px;margin-top:4px;'&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; $main .= &quot;&lt;/table&gt;&quot;;<br />
&nbsp;  }<br />
&nbsp;  $main .= &quot;&lt;center&gt;&lt;br&gt;&lt;br&gt;<br />
&nbsp; &nbsp; &nbsp;  &lt;input type='button' name='b1' class='bttn' value='Add Youtube Video' onclick=\&quot;location.replace('$base_url/myvideos.php?mode=addy');\&quot;&gt; &amp;nbsp; &amp;nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;  &lt;/center&gt;&lt;/div&gt;&quot;;<br />
&nbsp;  $main .= tabe();<br />
&nbsp;  $main .= &quot;&lt;div style='line-height:19px;margin-left:20px;margin-bottom:20px'&gt;Easily import your favorite YouTube videos and share them with members. No uploading required. &lt;br /&gt; &lt;a href='&quot;.URL::page('faq').&quot;'&gt;Support&lt;/a&gt; &lt;/div&gt;&quot;;<br />
}<br />
<br />
$_vtemplate['main'] = $main;<br />
$_vtemplate['right'] = $right;<br />
$tp = new page($_vtemplate, 'template/default2.html');</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=10">Coding</category>
			<dc:creator>diabloroker</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369696</guid>
		</item>
		<item>
			<title>Live preview of PHP?</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369695&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 03:29:10 GMT</pubDate>
			<description><![CDATA[I'm trying to put together a small subscription-type website.  It will have one main database-type program.   Nothing very elaborate.  For the content pages, I'm using HTML and CSS, of course.  For the program, I expect to use PHP and MySQL.  I'm teaching myself the latter -- as you might expect, I have my good days and my bad days.  :)

I've been looking at editors and have researched them to the point of overload.  Still, I expect that one could help me quite a lot.   One of the features I would most like is a live preview of PHP pages.   But . . . is that a realistic expectation?   

I'm just not in a position right now to purchase anything like Dreamweaver.   I've been looking seriously at Webuilder 2010 (http://www.blumentals.net/webuilder/).   

Two questions, I guess: 
1:  Does anyone know of any reason why Webuilder 2010 would be a bad idea?  (I'll use the trial version first, of course.)  

2:   Would I need to install a web server on my computer in order to have a preview of PHP pages?  I really don't want to do that, I don't think.  How much of a hassle would it be, though?  to what extent would I really need it??   

Any help would be much appreciated, and would probably help me stop going around in all these circles!]]></description>
			<content:encoded><![CDATA[<div>I'm trying to put together a small subscription-type website.  It will have one main database-type program.   Nothing very elaborate.  For the content pages, I'm using HTML and CSS, of course.  For the program, I expect to use PHP and MySQL.  I'm teaching myself the latter -- as you might expect, I have my good days and my bad days.  :)<br />
<br />
I've been looking at editors and have researched them to the point of overload.  Still, I expect that one could help me quite a lot.   One of the features I would most like is a live preview of PHP pages.   But . . . is that a realistic expectation?   <br />
<br />
I'm just not in a position right now to purchase anything like Dreamweaver.   I've been looking seriously at <a rel="nofollow" href="http://www.blumentals.net/webuilder/" target="_blank">Webuilder 2010</a>.   <br />
<br />
Two questions, I guess: <br />
1:  Does anyone know of any reason why Webuilder 2010 would be a bad idea?  (I'll use the trial version first, of course.)  <br />
<br />
2:   Would I need to install a web server on my computer in order to have a preview of PHP pages?  I really don't want to do that, I don't think.  How much of a hassle would it be, though?  to what extent would I really need it??   <br />
<br />
Any help would be much appreciated, and would probably help me stop going around in all these circles!</div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=3">Newbies</category>
			<dc:creator>Francoise</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369695</guid>
		</item>
		<item>
			<title>Need help displaying results of FOREACH in 4 columns</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369694&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 00:09:46 GMT</pubDate>
			<description><![CDATA[Hi guys,

I need some help.:confused:

I have a .inc file for the queries and a separate php file to echo the results.

Now what I want to do is echo 2 results per line, but I can't find the right solution on the internet. Now I am quite new to this, so it might be just my inability to translate the given solutions to my situation.

What I want is that the following foreach: 
*"foreach($projectStatusEntries as $projectStatusEntry" *
displays a total of 10 statusfields as below:

*Header1*      Value1      *Header2*      Value2
*Header3*      Value3      *Header4*      Value4
*Header5*      Value5      *Header6*      Value6
*Header7*      Value7      *Header8*      Value8
*Header9*      Value9      *Header10*      Value10



Ofcourse it also fine, if the first 5 results are listed in the left column and the other 5 are listed in the right column.

Can anyone help me to get this fixed??
I've been messing around myself for quite some time now, but can't get it to work.

Thanks in advance (i have attached the 2 relevant files below)

This is the .inc file


---Quote---
<?php

	require_once("domain.inc");

	class ProjectStatusEntry extends Domain {
		var $projectId;
		var $projectStatusId;
		var $statusId;

		function ProjectStatusEntry($id=0) {
			$this->id = $id;
		}
		
	}

	class ProjectStatusEntryDAO extends DomainDAO {

		public static function getAllProjectStatusEntries($projectId) {
			$query = "SELECT * FROM project_status_entries WHERE project_id = ".$projectId;
	    return ProjectStatusEntryDAO::queryProjectStatusEntries($query);
		}

		public static function findProjectStatusEntryById($id) {
			$query = "SELECT * FROM project_status_entries WHERE id=$id";
			$results = mysql_query($query);
	    $line = mysql_fetch_array($results);
			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);
			
			mysql_free_result($results);
	    
	    return $projectStatusEntry;
		}		

		public static function findProjectStatusEntryByProjectStatusId($projectId, $projectStatusId) {
			$query = "SELECT * FROM project_status_entries WHERE project_id = $projectId AND project_status_id=.$projectStatusId";
			$results = mysql_query($query);
	    $line = mysql_fetch_array($results);
			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);
			
			mysql_free_result($results);
	    
	    return $projectStatusEntry;
		}		

		private static function queryProjectStatusEntries($query) {
			$query = $query." ORDER BY id";
			$results = mysql_query($query);
			$projectStatusEntries = array();
			if($results) {
		    while ($line = mysql_fetch_array($results)) {
		    			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);
				    	$projectStatusEntries[$projectStatusEntry->id] = $projectStatusEntry;

		    }
		    
				mysql_free_result($results);
			}
			
	    return $projectStatusEntries;
		}	

		private static function queryProjectStatusEntry($query) {
			$results = mysql_query($query);
			$projectStatusEntry = null;
	    if($line = mysql_fetch_array($results)) {
	    			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);
	    }
	    
			mysql_free_result($results);
			
	  	return $projectStatusEntry;
		}

		public static function getProjectStatusEntryFromResultSet($line) {
			$projectStatusEntry = new ProjectStatusEntry();
	    $projectStatusEntry->id = $line["id"];
	    $projectStatusEntry->projectId = $line["project_id"];
	    $projectStatusEntry->projectStatusId = $line["project_status_id"];
	    $projectStatusEntry->statusId = $line["status_id"];

	    
	    return $projectStatusEntry;
		}
		
		public static function saveProjectStatusEntry($projectStatusEntry) {
			if($projectStatusEntry->id > 0) {
				$statement = "UPDATE project_status_entries SET "
				." project_id='".$projectStatusEntry->projectId."',"
				." project_status_id='".$projectStatusEntry->projectStatusId."',"
				." status_id='".$projectStatusEntry->statusId."'"
				." WHERE id=".$projectStatusEntry->id;
			} 
			
			else {
				$statement = "INSERT INTO project_status_entries (project_id, project_status_id, status_id)" 
				." VALUES ("
				."'$projectStatusEntry->projectId',"
				."'$projectStatusEntry->projectStatusId',"
				."'$projectStatusEntry->statusId'"
				.")"
				;
			}
			
			$result = mysql_query($statement);
			
			DomainDAO::checkErrors($statement);
			DomainDAO::updateId($projectStatusEntry);

			return $projectStatusEntry;
		}
		
	}
	
?>
---End Quote---
And this is (part of) the PHP file


---Quote---
<?php include_once("../includes/pdfheader.inc"); ?>
<?php include_once("../includes/util.inc"); ?>
<?php include_once("../domain/projects.inc"); ?>
<?php include_once("../domain/benefits.inc"); ?>
<?php include_once("../domain/resources.inc"); ?>
<?php include_once("../domain/projectresources.inc"); ?>
<?php include_once("../domain/projectdependencies.inc"); ?>
<?php include_once("../domain/campaigndependencies.inc"); ?>
<?php include_once("../domain/phases.inc"); ?>
<?php include_once("../domain/campaigns.inc"); ?>
<?php include_once("../domain/projectphases.inc"); ?>
<?php include_once("../domain/deliverables.inc"); ?>
<?php include_once("../domain/projectissues.inc"); ?>
<?php include_once("../domain/projectrisks.inc"); ?>
<?php include_once("../domain/businesspriorities.inc"); ?>
<?php include_once("../domain/budgetfundingtypes.inc"); ?>
<?php include_once("../domain/projectstatusentries.inc"); ?>
<?php include_once("../domain/projectstatuses.inc"); ?>
<?php include_once("../domain/statuses.inc"); ?>
<?
	import_request_variables("gp", "p_");
	
	$project = ProjectDAO::findById($p_id);
	$benefits = BenefitDAO::getAllBenefits($p_id);
	$resources = ResourceDAO::getAllResources();
	$phases = PhaseDAO::getAllPhases();
	$resourceTypes = ResourceDAO::getAllResourceTypes();
	$projectResources = ProjectResourceDAO::getProjectResources($p_id);
	$projectDependencies = ProjectDependencyDAO::getProjectDependencies($p_id);
	$campaignDependencies = CampaignDependencyDAO::getAllCampaignDependencies($p_id);
	$projectphases = ProjectPhaseDAO::getAllProjectPhases($p_id);
	$deliverables = DeliverableDAO::getAllDeliverables($p_id);
	$projectissues = ProjectIssueDAO::getAllProjectIssues($p_id);
	$projectrisks = ProjectRiskDAO::getAllProjectRisks($p_id);
	$projectBenefits = BenefitDAO::getProjectBenefits($p_id);
	$businesspriorities = BusinessPriorityDAO::getAllBusinessPriorities($p_id);
	$campaigns = CampaignDAO::getAllCampaigns();
	$budgetFundingTypes = BudgetFundingTypeDAO::getAllBudgetFundingTypes();
	$projectstatuses = ProjectStatusDAO::getAllProjectStatuses();
	$statuses = StatusDAO::getAllStatuses();			
	$projectStatusEntries = ProjectStatusEntryDAO::getAllProjectStatusEntries($p_id);
	$actualprojectphase = ProjectPhaseDAO::getActualProjectPhase($p_id);

?>
		<h2>Project Dashboard</h2>
		
		<table border="1" width="100%">	
		<tbody>
		<? foreach($projectStatusEntries as $projectStatusEntry) { ?>
		<tr>
			<td>
				<?=$projectstatuses[$projectStatusEntry->projectStatusId]->projectStatusName?>
			</td>
			<td class="status<?=$projectStatusEntry->statusId?>">
		<?
			if(isset($statuses[$projectStatusEntry->statusId])) {
				echo $statuses[$projectStatusEntry->statusId]->statusName;
			} else {
				echo "status $projectStatusEntry->statusId onbekend";
			}
		?>
			</td>
			</tr>
		<? } ?>
		</tbody>
		</table>
<?php include_once("../includes/htmlfooter.inc"); ?>
---End Quote---
]]></description>
			<content:encoded><![CDATA[<div>Hi guys,<br />
<br />
I need some help.:confused:<br />
<br />
I have a .inc file for the queries and a separate php file to echo the results.<br />
<br />
Now what I want to do is echo 2 results per line, but I can't find the right solution on the internet. Now I am quite new to this, so it might be just my inability to translate the given solutions to my situation.<br />
<br />
What I want is that the following foreach: <br />
<b>&quot;foreach($projectStatusEntries as $projectStatusEntry&quot; </b><br />
displays a total of 10 statusfields as below:<br />
<br />
<b>Header1</b>      Value1      <b>Header2</b>      Value2<br />
<b>Header3</b>      Value3      <b>Header4</b>      Value4<br />
<b>Header5</b>      Value5      <b>Header6</b>      Value6<br />
<b>Header7</b>      Value7      <b>Header8</b>      Value8<br />
<b>Header9</b>      Value9      <b>Header10</b>      Value10<br />
<br />
<br />
<br />
Ofcourse it also fine, if the first 5 results are listed in the left column and the other 5 are listed in the right column.<br />
<br />
Can anyone help me to get this fixed??<br />
I've been messing around myself for quite some time now, but can't get it to work.<br />
<br />
Thanks in advance (i have attached the 2 relevant files below)<br />
<br />
This is the .inc file<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 />
			
				&lt;?php<br />
<br />
	require_once(&quot;domain.inc&quot;);<br />
<br />
	class ProjectStatusEntry extends Domain {<br />
		var $projectId;<br />
		var $projectStatusId;<br />
		var $statusId;<br />
<br />
		function ProjectStatusEntry($id=0) {<br />
			$this-&gt;id = $id;<br />
		}<br />
		<br />
	}<br />
<br />
	class ProjectStatusEntryDAO extends DomainDAO {<br />
<br />
		public static function getAllProjectStatusEntries($projectId) {<br />
			$query = &quot;SELECT * FROM project_status_entries WHERE project_id = &quot;.$projectId;<br />
	    return ProjectStatusEntryDAO::queryProjectStatusEntries($query);<br />
		}<br />
<br />
		public static function findProjectStatusEntryById($id) {<br />
			$query = &quot;SELECT * FROM project_status_entries WHERE id=$id&quot;;<br />
			$results = mysql_query($query);<br />
	    $line = mysql_fetch_array($results);<br />
			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);<br />
			<br />
			mysql_free_result($results);<br />
	    <br />
	    return $projectStatusEntry;<br />
		}		<br />
<br />
		public static function findProjectStatusEntryByProjectStatusId($projectId, $projectStatusId) {<br />
			$query = &quot;SELECT * FROM project_status_entries WHERE project_id = $projectId AND project_status_id=.$projectStatusId&quot;;<br />
			$results = mysql_query($query);<br />
	    $line = mysql_fetch_array($results);<br />
			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);<br />
			<br />
			mysql_free_result($results);<br />
	    <br />
	    return $projectStatusEntry;<br />
		}		<br />
<br />
		private static function queryProjectStatusEntries($query) {<br />
			$query = $query.&quot; ORDER BY id&quot;;<br />
			$results = mysql_query($query);<br />
			$projectStatusEntries = array();<br />
			if($results) {<br />
		    while ($line = mysql_fetch_array($results)) {<br />
		    			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);<br />
				    	$projectStatusEntries[$projectStatusEntry-&gt;id] = $projectStatusEntry;<br />
<br />
		    }<br />
		    <br />
				mysql_free_result($results);<br />
			}<br />
			<br />
	    return $projectStatusEntries;<br />
		}	<br />
<br />
		private static function queryProjectStatusEntry($query) {<br />
			$results = mysql_query($query);<br />
			$projectStatusEntry = null;<br />
	    if($line = mysql_fetch_array($results)) {<br />
	    			$projectStatusEntry = ProjectStatusEntryDAO::getProjectStatusEntryFromResultSet($line);<br />
	    }<br />
	    <br />
			mysql_free_result($results);<br />
			<br />
	  	return $projectStatusEntry;<br />
		}<br />
<br />
		public static function getProjectStatusEntryFromResultSet($line) {<br />
			$projectStatusEntry = new ProjectStatusEntry();<br />
	    $projectStatusEntry-&gt;id = $line[&quot;id&quot;];<br />
	    $projectStatusEntry-&gt;projectId = $line[&quot;project_id&quot;];<br />
	    $projectStatusEntry-&gt;projectStatusId = $line[&quot;project_status_id&quot;];<br />
	    $projectStatusEntry-&gt;statusId = $line[&quot;status_id&quot;];<br />
<br />
	    <br />
	    return $projectStatusEntry;<br />
		}<br />
		<br />
		public static function saveProjectStatusEntry($projectStatusEntry) {<br />
			if($projectStatusEntry-&gt;id &gt; 0) {<br />
				$statement = &quot;UPDATE project_status_entries SET &quot;<br />
				.&quot; project_id='&quot;.$projectStatusEntry-&gt;projectId.&quot;',&quot;<br />
				.&quot; project_status_id='&quot;.$projectStatusEntry-&gt;projectStatusId.&quot;',&quot;<br />
				.&quot; status_id='&quot;.$projectStatusEntry-&gt;statusId.&quot;'&quot;<br />
				.&quot; WHERE id=&quot;.$projectStatusEntry-&gt;id;<br />
			} <br />
			<br />
			else {<br />
				$statement = &quot;INSERT INTO project_status_entries (project_id, project_status_id, status_id)&quot; <br />
				.&quot; VALUES (&quot;<br />
				.&quot;'$projectStatusEntry-&gt;projectId',&quot;<br />
				.&quot;'$projectStatusEntry-&gt;projectStatusId',&quot;<br />
				.&quot;'$projectStatusEntry-&gt;statusId'&quot;<br />
				.&quot;)&quot;<br />
				;<br />
			}<br />
			<br />
			$result = mysql_query($statement);<br />
			<br />
			DomainDAO::checkErrors($statement);<br />
			DomainDAO::updateId($projectStatusEntry);<br />
<br />
			return $projectStatusEntry;<br />
		}<br />
		<br />
	}<br />
	<br />
?&gt;
			
			<hr />
		</td>
	</tr>
	</table>
</div>And this is (part of) the PHP file<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 />
			
				&lt;?php include_once(&quot;../includes/pdfheader.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../includes/util.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projects.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/benefits.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/resources.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectresources.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectdependencies.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/campaigndependencies.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/phases.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/campaigns.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectphases.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/deliverables.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectissues.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectrisks.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/businesspriorities.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/budgetfundingtypes.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectstatusentries.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/projectstatuses.inc&quot;); ?&gt;<br />
&lt;?php include_once(&quot;../domain/statuses.inc&quot;); ?&gt;<br />
&lt;?<br />
	import_request_variables(&quot;gp&quot;, &quot;p_&quot;);<br />
	<br />
	$project = ProjectDAO::findById($p_id);<br />
	$benefits = BenefitDAO::getAllBenefits($p_id);<br />
	$resources = ResourceDAO::getAllResources();<br />
	$phases = PhaseDAO::getAllPhases();<br />
	$resourceTypes = ResourceDAO::getAllResourceTypes();<br />
	$projectResources = ProjectResourceDAO::getProjectResources($p_id);<br />
	$projectDependencies = ProjectDependencyDAO::getProjectDependencies($p_id);<br />
	$campaignDependencies = CampaignDependencyDAO::getAllCampaignDependencies($p_id);<br />
	$projectphases = ProjectPhaseDAO::getAllProjectPhases($p_id);<br />
	$deliverables = DeliverableDAO::getAllDeliverables($p_id);<br />
	$projectissues = ProjectIssueDAO::getAllProjectIssues($p_id);<br />
	$projectrisks = ProjectRiskDAO::getAllProjectRisks($p_id);<br />
	$projectBenefits = BenefitDAO::getProjectBenefits($p_id);<br />
	$businesspriorities = BusinessPriorityDAO::getAllBusinessPriorities($p_id);<br />
	$campaigns = CampaignDAO::getAllCampaigns();<br />
	$budgetFundingTypes = BudgetFundingTypeDAO::getAllBudgetFundingTypes();<br />
	$projectstatuses = ProjectStatusDAO::getAllProjectStatuses();<br />
	$statuses = StatusDAO::getAllStatuses();			<br />
	$projectStatusEntries = ProjectStatusEntryDAO::getAllProjectStatusEntries($p_id);<br />
	$actualprojectphase = ProjectPhaseDAO::getActualProjectPhase($p_id);<br />
<br />
?&gt;<br />
		&lt;h2&gt;Project Dashboard&lt;/h2&gt;<br />
		<br />
		&lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;	<br />
		&lt;tbody&gt;<br />
		&lt;? foreach($projectStatusEntries as $projectStatusEntry) { ?&gt;<br />
		&lt;tr&gt;<br />
			&lt;td&gt;<br />
				&lt;?=$projectstatuses[$projectStatusEntry-&gt;projectStatusId]-&gt;projectStatusName?&gt;<br />
			&lt;/td&gt;<br />
			&lt;td class=&quot;status&lt;?=$projectStatusEntry-&gt;statusId?&gt;&quot;&gt;<br />
		&lt;?<br />
			if(isset($statuses[$projectStatusEntry-&gt;statusId])) {<br />
				echo $statuses[$projectStatusEntry-&gt;statusId]-&gt;statusName;<br />
			} else {<br />
				echo &quot;status $projectStatusEntry-&gt;statusId onbekend&quot;;<br />
			}<br />
		?&gt;<br />
			&lt;/td&gt;<br />
			&lt;/tr&gt;<br />
		&lt;? } ?&gt;<br />
		&lt;/tbody&gt;<br />
		&lt;/table&gt;<br />
&lt;?php include_once(&quot;../includes/htmlfooter.inc&quot;); ?&gt;
			
			<hr />
		</td>
	</tr>
	</table>
</div></div>

]]></content:encoded>
			<category domain="http://www.phpbuilder.com/board/forumdisplay.php?f=6">Database</category>
			<dc:creator>Mariniertje</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369694</guid>
		</item>
		<item>
			<title>Need help with this articles display</title>
			<link>http://www.phpbuilder.com/board/showthread.php?t=10369693&amp;goto=newpost</link>
			<pubDate>Fri, 20 Nov 2009 23:33:02 GMT</pubDate>
			<description><![CDATA[I need help to properly script this echo php script that displays recent articles from wordpress on static homepage.  It's doing weird things.
First, it spits out the actual permalink
Secondly, after the permalink it spits out the Title but it disregards all the <h1>/<h4> tag styling, and the title is not a link, which it should be.

It displays the content correctly, but the title incorrectly. Because it should display a clickagle title with <h1>/<h4> styles rendered and the permalink is the actual link for the Title.

Please help.



PHP:
---------
 <?php 
$recent = new WP_Query("cat=1&showposts=6");
$i = 0;
while($recent->have_posts()) : $recent->the_post();
  if($i == 0){
    echo '<h1><a href="';
    the_permalink();
    echo '" rel="bookmark">'.the_title().'</a></h1>';
    if (function_exists('the_content_limit')){
          the_content_limit(195, "<span class='read-more'>Read more &raquo;</span>"); 
    }
  }else{
    echo '<h4><a href="';
    the_permalink();
    echo '" rel="bookmark">'.the_title().'</a></h4>';
    the_content_limit(130, "");
    echo '<div class="hppostmeta">';
    echo '<p>'.the_time('F j, Y').' | <a href="';
    the_permalink();
    echo '" rel="bookmark">Read the story &raquo;</a></p>';
    echo '</div>';
  }
echo '<div style="clear:both;"></div>';
$i++;
endwhile; ?>
---------
]]></description>
			<content:encoded><![CDATA[<div>I need help to properly script this echo php script that displays recent articles from wordpress on static homepage.  It's doing weird things.<br />
First, it spits out the actual permalink<br />
Secondly, after the permalink it spits out the Title but it disregards all the &lt;h1&gt;/&lt;h4&gt; tag styling, and the title is not a link, which it should be.<br />
<br />
It displays the content correctly, but the title incorrectly. Because it should display a clickagle title with &lt;h1&gt;/&lt;h4&gt; styles rendered and the permalink is the actual link for the Title.<br />
<br />
Please help.<br />
<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 />$recent </font><font color="#007700">= new </font><font color="#0000BB">WP_Query</font><font color="#007700">(</font><font color="#DD0000">"cat=1&amp;showposts=6"</font><font color="#007700">);<br /></font><font color="#0000BB">$i </font><font color="#007700">= </font><font color="#0000BB">0</font><font color="#007700">;<br />while(</font><font color="#0000BB">$recent</font><font color="#007700">-&gt;</font><font color="#0000BB">have_posts</font><font color="#007700">()) : </font><font color="#0000BB">$recent</font><font color="#007700">-&gt;</font><font color="#0000BB">the_post</font><font color="#007700">();<br />&nbsp;&nbsp;if(</font><font color="#0000BB">$i </font><font color="#007700">== </font><font color="#0000BB">0</font><font color="#007700">){<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;h1&gt;&lt;a href="'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">the_permalink</font><font color="#007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'" rel="bookmark"&gt;'</font><font color="#007700">.</font><font color="#0000BB">the_title</font><font color="#007700">().</font><font color="#DD0000">'&lt;/a&gt;&lt;/h1&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">function_exists</font><font color="#007700">(</font><font color="#DD0000">'the_content_limit'</font><font color="#007700">)){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">the_content_limit</font><font color="#007700">(</font><font color="#0000BB">195</font><font color="#007700">, </font><font color="#DD0000">"&lt;span class='read-more'&gt;Read more &amp;raquo;&lt;/span&gt;"</font><font color="#007700">); <br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;h4&gt;&lt;a href="'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">the_permalink</font><font color="#007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'" rel="bookmark"&gt;'</font><font color="#007700">.</font><font color="#0000BB">the_title</font><font color="#007700">().</font><font color="#DD0000">'&lt;/a&gt;&lt;/h4&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">the_content_limit</font><font color="#007700">(</font><font color="#0000BB">130</font><font color="#007700">, </font><font color="#DD0000">""</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;div class="hppostmeta"&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;p&gt;'</font><font color="#007700">.</font><font color="#0000BB">the_time</font><font color="#007700">(</font><font color="#DD0000">'F j, Y'</font><font color="#007700">).</font><font color="#DD0000">' | &lt;a href="'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">the_permalink</font><font color="#007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'" rel="bookmark"&gt;Read the story &amp;raquo;&lt;/a&gt;&lt;/p&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'&lt;/div&gt;'</font><font color="#007700">;<br />&nbsp;&nbsp;}<br />echo </font><font color="#DD0000">'&lt;div style="clear:both;"&gt;&lt;/div&gt;'</font><font color="#007700">;<br /></font><font color="#0000BB">$i</font><font color="#007700">++;<br />endwhile; </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=2">General Help</category>
			<dc:creator>bgbs</dc:creator>
			<guid isPermaLink="true">http://www.phpbuilder.com/board/showthread.php?t=10369693</guid>
		</item>
	</channel>
</rss>
