This is a discussion on displaying grouped items when using count() within the MySQL Database forums, part of the Database Forums category; Not sure how to explain what it is I am after, so forgive me if the subject does not help. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Not sure how to explain what it is I am after, so forgive me if the
subject does not help. Basically I have a two tables like so: table1 ( id int(5) auto_increment primary key, code char(11), account_number char(11) ) table2 ( company_id char(11) primary key, company_name char(100) ) I have created the following query: $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM table1 JOIN table2 ON table1.account_number = table2.company_id GROUP BY code ORDER BY COUNT(*) "); This works as expected and i have a webpage that outputs like so: Code1 - There are 14 companies that buy this product. Code5 - There are 12 companies that buy this product. Code9 - There are 6 companies that buy this product. Code22 - There is 1 company that buys this product, which is: A0001. However, I would like to display the account numbers, that have been grouped against the code when there is more than 1, like this: Code9 - There are 6 companies that buy this product, which are: A0001, A0002, A0004, C0020, C00030, P2210 I have done searches on google against COUNT(), but havent come across anything that seems to be what im looking for. (Not even sure if its possible). If anyone can point me in the right direction, would be most grateful. Thanks Dave. |
|
|||
|
On Mon, 03 Sep 2007 15:27:10 +0200, Dave
<david.greenhall@praybourne.co.uk> wrote: > Not sure how to explain what it is I am after, so forgive me if the > subject does not help. > > Basically > > I have a two tables like so: > > table1 ( > id int(5) auto_increment primary key, > code char(11), > account_number char(11) > ) > > > table2 ( > company_id char(11) primary key, > company_name char(100) > ) > > I have created the following query: > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM > table1 > JOIN table2 ON table1.account_number = table2.company_id > GROUP BY code ORDER BY COUNT(*) "); Possibly (untested) SELECT table1.code, COUNT(DISTINCT table2.company_id) as 'amount', GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as 'companies' # or if you like GROUP_CONCAT(DISTINCT table2.company_name SEPARATOR ',' as 'companies' FROM table1 LEFT JOIN table2 ON table1.account_number = table2.company_id GROUP BY table1.code ORDER BY `amount` -- Rik Wasmus |
|
|||
|
On 3 Sep, 15:14, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Mon, 03 Sep 2007 15:27:10 +0200, Dave > > > > > > <david.greenh...@praybourne.co.uk> wrote: > > Not sure how to explain what it is I am after, so forgive me if the > > subject does not help. > > > Basically > > > I have a two tables like so: > > > table1 ( > > id int(5) auto_increment primary key, > > code char(11), > > account_number char(11) > > ) > > > table2 ( > > company_id char(11) primary key, > > company_name char(100) > > ) > > > I have created the following query: > > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM > > table1 > > JOIN table2 ON table1.account_number = table2.company_id > > GROUP BY code ORDER BY COUNT(*) "); > > Possibly (untested) > > SELECT > table1.code, > COUNT(DISTINCT table2.company_id) as 'amount', > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as 'companies' > # or if you like GROUP_CONCAT(DISTINCT table2.company_name SEPARATOR ', ' > as 'companies' > FROM table1 > LEFT JOIN table2 > ON table1.account_number = table2.company_id > GROUP BY table1.code > ORDER BY `amount` > -- > Rik Wasmus- Hide quoted text - > > - Show quoted text - Still untested but more likely to run: SELECT table1.code, COUNT(DISTINCT table2.company_id) as `amount`, GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ') as `companies` # or if you like GROUP_CONCAT(DISTINCT table2.company_name SEPARATOR ', ') as `companies` FROM table1 LEFT JOIN table2 ON table1.account_number = table2.company_id GROUP BY table1.code ORDER BY `amount` |
|
|||
|
On 3 Sep, 15:44, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 3 Sep, 15:14, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: > > > > > On Mon, 03 Sep 2007 15:27:10 +0200, Dave > > > <david.greenh...@praybourne.co.uk> wrote: > > > Not sure how to explain what it is I am after, so forgive me if the > > > subject does not help. > > > > Basically > > > > I have a two tables like so: > > > > table1 ( > > > id int(5) auto_increment primary key, > > > code char(11), > > > account_number char(11) > > > ) > > > > table2 ( > > > company_id char(11) primary key, > > > company_name char(100) > > > ) > > > > I have created the following query: > > > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM > > > table1 > > > JOIN table2 ON table1.account_number = table2.company_id > > > GROUP BY code ORDER BY COUNT(*) "); > > > Possibly (untested) > > > SELECT > > table1.code, > > COUNT(DISTINCT table2.company_id) as 'amount', > > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as 'companies' > > # or if you like GROUP_CONCAT(DISTINCT table2.company_name SEPARATOR ', ' > > as 'companies' > > FROM table1 > > LEFT JOIN table2 > > ON table1.account_number = table2.company_id > > GROUP BY table1.code > > ORDER BY `amount` > > -- > > Rik Wasmus- Hide quoted text - > > > - Show quoted text - > > Still untested but more likely to run: > > SELECT > table1.code, > COUNT(DISTINCT table2.company_id) as `amount`, > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ') as > `companies` > # or if you like GROUP_CONCAT(DISTINCT table2.company_name > SEPARATOR ', ') > as `companies` > FROM table1 > LEFT JOIN table2 > ON table1.account_number = table2.company_id > GROUP BY table1.code > ORDER BY `amount`- Hide quoted text - > > - Show quoted text - Thanks a lot folks, that works really well.. But... Is there a way to seperate them so that i create a link for each company? Previously i had an if statement, that if the count was equal to one, it created a link around the account number that was brought back, using the account number to link to another page (like: company.php? account=A0001 ) When i added the new code, it wouldnt work with the if statement, but once removed it displayed all the account numbers as expected (thanks) ...just need a way to add links to them (if anyone knows a way) !! Dave. The way it is now, |
|
|||
|
On Mon, 03 Sep 2007 17:24:04 +0200, Dave
<david.greenhall@praybourne.co.uk> wrote: > On 3 Sep, 15:44, Captain Paralytic <paul_laut...@yahoo.com> wrote: >> On 3 Sep, 15:14, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: >> >> >> >> > On Mon, 03 Sep 2007 15:27:10 +0200, Dave >> >> > <david.greenh...@praybourne.co.uk> wrote: >> > > Not sure how to explain what it is I am after, so forgive me if the >> > > subject does not help. >> >> > > Basically >> >> > > I have a two tables like so: >> >> > > table1 ( >> > > id int(5) auto_increment primary key, >> > > code char(11), >> > > account_number char(11) >> > > ) >> >> > > table2 ( >> > > company_id char(11) primary key, >> > > company_name char(100) >> > > ) >> >> > > I have created the following query: >> > > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM >> > > table1 >> > > JOIN table2 ON table1.account_number = table2.company_id >> > > GROUP BY code ORDER BY COUNT(*) "); >> >> > Possibly (untested) >> >> > SELECT >> > table1.code, >> > COUNT(DISTINCT table2.company_id) as 'amount', >> > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as >> 'companies' >> > # or if you like GROUP_CONCAT(DISTINCT table2.company_name >> SEPARATOR ', ' >> > as 'companies' >> > FROM table1 >> > LEFT JOIN table2 >> > ON table1.account_number = table2.company_id >> > GROUP BY table1.code >> > ORDER BY `amount` >> > -- >> > Rik Wasmus- Hide quoted text - >> >> > - Show quoted text - >> >> Still untested but more likely to run: >> >> SELECT >> table1.code, >> COUNT(DISTINCT table2.company_id) as `amount`, >> GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ') as >> `companies` >> # or if you like GROUP_CONCAT(DISTINCT table2.company_name >> SEPARATOR ', ') >> as `companies` >> FROM table1 >> LEFT JOIN table2 >> ON table1.account_number = table2.company_id >> GROUP BY table1.code >> ORDER BY `amount`- Hide quoted text - >> >> - Show quoted text - > > Thanks a lot folks, that works really well.. But... Is there a way to > seperate them so that i create a link for each company? > Previously i had an if statement, that if the count was equal to one, > it created a link around the account number that was brought back, > using the account number to link to another page (like: company.php? > account=A0001 ) > > When i added the new code, it wouldnt work with the if statement, but > once removed it displayed all the account numbers as expected > (thanks) ...just need a way to add links to them (if anyone knows a > way) !! Depends on what code/language you use. In PHP for instance, a simple explode() could break it up into parts again. Offcourse converting it into HTML could be done in the query itself, I would strongly advice against it though, something like: .... GROUP_CONCAT( DISTINCT CONCAT( '<a href="./company.php?account=', table2.company_id, '">', table2.company_name, '</a>') SEPARATOR '') as 'companyurls' .... -- Rik Wasmus |
|
|||
|
On 3 Sep, 17:03, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Mon, 03 Sep 2007 17:24:04 +0200, Dave > > > > > > <david.greenh...@praybourne.co.uk> wrote: > > On 3 Sep, 15:44, Captain Paralytic <paul_laut...@yahoo.com> wrote: > >> On 3 Sep, 15:14, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: > > >> > On Mon, 03 Sep 2007 15:27:10 +0200, Dave > > >> > <david.greenh...@praybourne.co.uk> wrote: > >> > > Not sure how to explain what it is I am after, so forgive me if the > >> > > subject does not help. > > >> > > Basically > > >> > > I have a two tables like so: > > >> > > table1 ( > >> > > id int(5) auto_increment primary key, > >> > > code char(11), > >> > > account_number char(11) > >> > > ) > > >> > > table2 ( > >> > > company_id char(11) primary key, > >> > > company_name char(100) > >> > > ) > > >> > > I have created the following query: > >> > > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM > >> > > table1 > >> > > JOIN table2 ON table1.account_number = table2.company_id > >> > > GROUP BY code ORDER BY COUNT(*) "); > > >> > Possibly (untested) > > >> > SELECT > >> > table1.code, > >> > COUNT(DISTINCT table2.company_id) as 'amount', > >> > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as > >> 'companies' > >> > # or if you like GROUP_CONCAT(DISTINCT table2.company_name > >> SEPARATOR ', ' > >> > as 'companies' > >> > FROM table1 > >> > LEFT JOIN table2 > >> > ON table1.account_number = table2.company_id > >> > GROUP BY table1.code > >> > ORDER BY `amount` > >> > -- > >> > Rik Wasmus- Hide quoted text - > > >> > - Show quoted text - > > >> Still untested but more likely to run: > > >> SELECT > >> table1.code, > >> COUNT(DISTINCT table2.company_id) as `amount`, > >> GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ') as > >> `companies` > >> # or if you like GROUP_CONCAT(DISTINCT table2.company_name > >> SEPARATOR ', ') > >> as `companies` > >> FROM table1 > >> LEFT JOIN table2 > >> ON table1.account_number = table2.company_id > >> GROUP BY table1.code > >> ORDER BY `amount`- Hide quoted text - > > >> - Show quoted text - > > > Thanks a lot folks, that works really well.. But... Is there a way to > > seperate them so that i create a link for each company? > > Previously i had an if statement, that if the count was equal to one, > > it created a link around the account number that was brought back, > > using the account number to link to another page (like: company.php? > > account=A0001 ) > > > When i added the new code, it wouldnt work with the if statement, but > > once removed it displayed all the account numbers as expected > > (thanks) ...just need a way to add links to them (if anyone knows a > > way) !! > > Depends on what code/language you use. In PHP for instance, a simple > explode() could break it up into parts again. > > Offcourse converting it into HTML could be done in the query itself, I > would strongly advice against it though, something like: > ... > GROUP_CONCAT( > DISTINCT > CONCAT( > '<a href="./company.php?account=', > table2.company_id, > '">', > table2.company_name, > '</a>') > SEPARATOR '') as 'companyurls' > ... > > -- > Rik Wasmus- Hide quoted text - > > - Show quoted text - Doh! explode() !! damn sorry for wasting your time. I sorted it with explode() and a foreach statement, and incase anyone else wonders, example is below. if ($query['amount'] > 1) { echo "<td colspan=2>There are <b>"; echo " " .$query['amount']. " </b>Companies who buy this product </ td><tr><td colspan=3>They are: "; $companyextract = explode(", ",$query['companies']); foreach ($companyextract as &$comp) { echo "<a href=company.php?account="; echo $comp; echo "><b>" ; echo $comp; echo "</b></a> "; } } else { echo "<td colspan=2>There is only <b>"; echo " " .$query['amount']. " </b>Company who buy this product </ td><tr><td colspan=3>That is: "; $companyextract = explode(", ",$query['companies']); foreach ($companyextract as &$comp) { echo "<a href=company.php?account="; echo $comp; echo "><b>" ; echo $comp; echo "</b></a>"; } Thanks again for everyones help Dave. |
|
|||
|
On 4 Sep, 13:15, Dave <david.greenh...@praybourne.co.uk> wrote:
> On 3 Sep, 17:03, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: > > > > > > > On Mon, 03 Sep 2007 17:24:04 +0200, Dave > > > <david.greenh...@praybourne.co.uk> wrote: > > > On 3 Sep, 15:44, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > >> On 3 Sep, 15:14, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: > > > >> > On Mon, 03 Sep 2007 15:27:10 +0200, Dave > > > >> > <david.greenh...@praybourne.co.uk> wrote: > > >> > > Not sure how to explain what it is I am after, so forgive me if the > > >> > > subject does not help. > > > >> > > Basically > > > >> > > I have a two tables like so: > > > >> > > table1 ( > > >> > > id int(5) auto_increment primary key, > > >> > > code char(11), > > >> > > account_number char(11) > > >> > > ) > > > >> > > table2 ( > > >> > > company_id char(11) primary key, > > >> > > company_name char(100) > > >> > > ) > > > >> > > I have created the following query: > > >> > > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM > > >> > > table1 > > >> > > JOIN table2 ON table1.account_number = table2.company_id > > >> > > GROUP BY code ORDER BY COUNT(*) "); > > > >> > Possibly (untested) > > > >> > SELECT > > >> > table1.code, > > >> > COUNT(DISTINCT table2.company_id) as 'amount', > > >> > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as > > >> 'companies' > > >> > # or if you like GROUP_CONCAT(DISTINCT table2.company_name > > >> SEPARATOR ', ' > > >> > as 'companies' > > >> > FROM table1 > > >> > LEFT JOIN table2 > > >> > ON table1.account_number = table2.company_id > > >> > GROUP BY table1.code > > >> > ORDER BY `amount` > > >> > -- > > >> > Rik Wasmus- Hide quoted text - > > > >> > - Show quoted text - > > > >> Still untested but more likely to run: > > > >> SELECT > > >> table1.code, > > >> COUNT(DISTINCT table2.company_id) as `amount`, > > >> GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ') as > > >> `companies` > > >> # or if you like GROUP_CONCAT(DISTINCT table2.company_name > > >> SEPARATOR ', ') > > >> as `companies` > > >> FROM table1 > > >> LEFT JOIN table2 > > >> ON table1.account_number = table2.company_id > > >> GROUP BY table1.code > > >> ORDER BY `amount`- Hide quoted text - > > > >> - Show quoted text - > > > > Thanks a lot folks, that works really well.. But... Is there a way to > > > seperate them so that i create a link for each company? > > > Previously i had an if statement, that if the count was equal to one, > > > it created a link around the account number that was brought back, > > > using the account number to link to another page (like: company.php? > > > account=A0001 ) > > > > When i added the new code, it wouldnt work with the if statement, but > > > once removed it displayed all the account numbers as expected > > > (thanks) ...just need a way to add links to them (if anyone knows a > > > way) !! > > > Depends on what code/language you use. In PHP for instance, a simple > > explode() could break it up into parts again. > > > Offcourse converting it into HTML could be done in the query itself, I > > would strongly advice against it though, something like: > > ... > > GROUP_CONCAT( > > DISTINCT > > CONCAT( > > '<a href="./company.php?account=', > > table2.company_id, > > '">', > > table2.company_name, > > '</a>') > > SEPARATOR '') as 'companyurls' > > ... > > > -- > > Rik Wasmus- Hide quoted text - > > > - Show quoted text - > > Doh! > > explode() !! damn sorry for wasting your time. I sorted it with > explode() and a foreach statement, and incase anyone else wonders, > example is below. > > if ($query['amount'] > 1) { > echo "<td colspan=2>There are <b>"; > echo " " .$query['amount']. " </b>Companies who buy this product </ > td><tr><td colspan=3>They are: "; > > $companyextract = explode(", ",$query['companies']); > foreach ($companyextract as &$comp) { > echo "<a href=company.php?account="; > echo $comp; > echo "><b>" ; > echo $comp; > echo "</b></a> "; > }} else { > > echo "<td colspan=2>There is only <b>"; > echo " " .$query['amount']. " </b>Company who buy this product </ > td><tr><td colspan=3>That is: "; > > $companyextract = explode(", ",$query['companies']); > foreach ($companyextract as &$comp) { > echo "<a href=company.php?account="; > echo $comp; > echo "><b>" ; > echo $comp; > echo "</b></a>"; > } > > Thanks again for everyones help > > Dave.- Hide quoted text - > > - Show quoted text - So what was the point of concatenating the result set in the first place? |
|
|||
|
On 4 Sep, 13:15, Dave <david.greenh...@praybourne.co.uk> wrote:
> explode() !! damn sorry for wasting your time. I sorted it with > explode() and a foreach statement, and incase anyone else wonders, > example is below. With a combination of implode(...,explode(...)) you can do it without the foreach! |
|
|||
|
On 4 Sep, 13:41, strawberry <zac.ca...@gmail.com> wrote:
> On 4 Sep, 13:15, Dave <david.greenh...@praybourne.co.uk> wrote: > > > > > > > On 3 Sep, 17:03, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: > > > > On Mon, 03 Sep 2007 17:24:04 +0200, Dave > > > > <david.greenh...@praybourne.co.uk> wrote: > > > > On 3 Sep, 15:44, Captain Paralytic <paul_laut...@yahoo.com> wrote: > > > >> On 3 Sep, 15:14, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: > > > > >> > On Mon, 03 Sep 2007 15:27:10 +0200, Dave > > > > >> > <david.greenh...@praybourne.co.uk> wrote: > > > >> > > Not sure how to explain what it is I am after, so forgive me if the > > > >> > > subject does not help. > > > > >> > > Basically > > > > >> > > I have a two tables like so: > > > > >> > > table1 ( > > > >> > > id int(5) auto_increment primary key, > > > >> > > code char(11), > > > >> > > account_number char(11) > > > >> > > ) > > > > >> > > table2 ( > > > >> > > company_id char(11) primary key, > > > >> > > company_name char(100) > > > >> > > ) > > > > >> > > I have created the following query: > > > >> > > $getcount = mysql_query("SELECT account_number,code, COUNT(*) FROM > > > >> > > table1 > > > >> > > JOIN table2 ON table1.account_number = table2.company_id > > > >> > > GROUP BY code ORDER BY COUNT(*) "); > > > > >> > Possibly (untested) > > > > >> > SELECT > > > >> > table1.code, > > > >> > COUNT(DISTINCT table2.company_id) as 'amount', > > > >> > GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ' as > > > >> 'companies' > > > >> > # or if you like GROUP_CONCAT(DISTINCT table2.company_name > > > >> SEPARATOR ', ' > > > >> > as 'companies' > > > >> > FROM table1 > > > >> > LEFT JOIN table2 > > > >> > ON table1.account_number = table2.company_id > > > >> > GROUP BY table1.code > > > >> > ORDER BY `amount` > > > >> > -- > > > >> > Rik Wasmus- Hide quoted text - > > > > >> > - Show quoted text - > > > > >> Still untested but more likely to run: > > > > >> SELECT > > > >> table1.code, > > > >> COUNT(DISTINCT table2.company_id) as `amount`, > > > >> GROUP_CONCAT(DISTINCT table2.company_id SEPARATOR ', ') as > > > >> `companies` > > > >> # or if you like GROUP_CONCAT(DISTINCT table2.company_name > > > >> SEPARATOR ', ') > > > >> as `companies` > > > >> FROM table1 > > > >> LEFT JOIN table2 > > > >> ON table1.account_number = table2.company_id > > > >> GROUP BY table1.code > > > >> ORDER BY `amount`- Hide quoted text - > > > > >> - Show quoted text - > > > > > Thanks a lot folks, that works really well.. But... Is there a way to > > > > seperate them so that i create a link for each company? > > > > Previously i had an if statement, that if the count was equal to one, > > > > it created a link around the account number that was brought back, > > > > using the account number to link to another page (like: company.php? > > > > account=A0001 ) > > > > > When i added the new code, it wouldnt work with the if statement, but > > > > once removed it displayed all the account numbers as expected > > > > (thanks) ...just need a way to add links to them (if anyone knows a > > > > way) !! > > > > Depends on what code/language you use. In PHP for instance, a simple > > > explode() could break it up into parts again. > > > > Offcourse converting it into HTML could be done in the query itself, I > > > would strongly advice against it though, something like: > > > ... > > > GROUP_CONCAT( > > > DISTINCT > > > CONCAT( > > > '<a href="./company.php?account=', > > > table2.company_id, > > > '">', > > > table2.company_name, > > > '</a>') > > > SEPARATOR '') as 'companyurls' > > > ... > > > > -- > > > Rik Wasmus- Hide quoted text - > > > > - Show quoted text - > > > Doh! > > > explode() !! damn sorry for wasting your time. I sorted it with > > explode() and a foreach statement, and incase anyone else wonders, > > example is below. > > > if ($query['amount'] > 1) { > > echo "<td colspan=2>There are <b>"; > > echo " " .$query['amount']. " </b>Companies who buy this product </ > > td><tr><td colspan=3>They are: "; > > > $companyextract = explode(", ",$query['companies']); > > foreach ($companyextract as &$comp) { > > echo "<a href=company.php?account="; > > echo $comp; > > echo "><b>" ; > > echo $comp; > > echo "</b></a> "; > > }} else { > > > echo "<td colspan=2>There is only <b>"; > > echo " " .$query['amount']. " </b>Company who buy this product </ > > td><tr><td colspan=3>That is: "; > > > $companyextract = explode(", ",$query['companies']); > > foreach ($companyextract as &$comp) { > > echo "<a href=company.php?account="; > > echo $comp; > > echo "><b>" ; > > echo $comp; > > echo "</b></a>"; > > } > > > Thanks again for everyones help > > > Dave.- Hide quoted text - > > > - Show quoted text - > > So what was the point of concatenating the result set in the first > place?- Hide quoted text - > > - Show quoted text - Strawberry, (sorry its been so long to get back, but been away) I use what i know to do the job, when i dont know something i find out how to do it. What i found did the job perfectly. I grouped the results to count them in one section of the page. Then in another section, display the account codes. |
|
|||
|
On 4 Sep, 13:42, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 4 Sep, 13:15, Dave <david.greenh...@praybourne.co.uk> wrote: > > > explode() !! damn sorry for wasting your time. I sorted it with > > explode() and a foreach statement, and incase anyone else wonders, > > example is below. > > With a combination of implode(...,explode(...)) you can do it without > the foreach! Captain Paralytic, I appreciate the help, I am learning as i go along, and knew about explode and foreach. I didnt know that i could use implode at the same time as explode. |