CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Help with a PHP/MySQL question.

Print topic Send  topic

Author Message
Glenn Holden
Posted: 03/12/2002, 1:16 PM

I know this isn't specifically CC related, but I'm using CC for this and I
know you may be able to help with this.

I'm looking for a reasonably simple and fast way to fill an array with the
results of a single column select query.

example results from query:

+-----------+
| productid |
+-----------+
| PS |
| PSLEB |
| MD1 |
| CPSS1 |
| CPSG1 |
| CPSP1 |
| CPSSR |
| CPSGR |
| ST1 |
| STFREE |
+-----------+

desired array:
$arr = array(PS,PSLEB,MD1,CPSS1,CPSG1,CPSSR,CPSGR,ST1,STFREE);




I'm using PHP with MySQL.

I've seen ways to fill an array with an entire single row. But I only need
one value from each row so mysql_query() and mysql_fetch_array() seem like
overkill. Does anyone have a function that might do this already or a
suggestion to get me started?

Ultimate Goal:
Basically, I want to interate through a set of ID's returned by the select
query and perform further querys based on each id in the result. An array
would be a clean way to step through it. If there is a
better/simpler/easier way to do this, please let me know. I'm new to PHP
(but not programming).

Thanks a bunch,
Glenn


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.