Re: [PHP] Loop issues

2007-11-19 Thread Dan Shirah
Jim, I used your suggestion and modified it a little bit. All of the names are pulled from the database, but for some reason once it has pulled all the names form each query it is adding an empty result to the end. So when I do a echo $row['first_name']. .$row['last_name'].br /\n; it is

Re: [PHP] Loop issues

2007-11-19 Thread Philip Thompson
On Nov 19, 2007 12:16 PM, Dan Shirah [EMAIL PROTECTED] wrote: Jim, I used your suggestion and modified it a little bit. All of the names are pulled from the database, but for some reason once it has pulled all the names form each query it is adding an empty result to the end. So when I do

Re: [PHP] Loop issues

2007-11-19 Thread Dan Shirah
FANTASIC! Worked like a champ! Thank you to everyone. On 11/19/07, Philip Thompson [EMAIL PROTECTED] wrote: On Nov 19, 2007 12:16 PM, Dan Shirah [EMAIL PROTECTED] wrote: Jim, I used your suggestion and modified it a little bit. All of the names are pulled from the database, but

Re: [PHP] Loop issues

2007-11-19 Thread Jim Lucas
Dan Shirah wrote: Jim, I used your suggestion and modified it a little bit. All of the names are pulled from the database, but for some reason once it has pulled all the names form each query it is adding an empty result to the end. So when I do a echo $row['first_name'].

Re: [PHP] Loop issues

2007-11-16 Thread Jeremy Mcentire
So, take a look at what's below and see how it works for you. ?php $get_cs = SELECT DISTINCT `request_type`, `card_id`, `first_name`, `last_name` FROM `support_payment_request` WHERE `card_id` = '{$id}'; $cs_type = mssql_query($get_cs) or die(mssql_get_last_message());

Re: [PHP] Loop issues

2007-11-16 Thread Dan Shirah
Yeah...see...I'm confused apparently! My while loop is getting all of the names correctly, apparently my problem is...once i get them, how do I echo each one out seperately? Based off of the print_r($cs_row) I can see all of the names. What should I be doing differently to output each name into

Re: [PHP] Loop issues

2007-11-16 Thread Jeremy Mcentire
I'm not sure what you're trying to do here; a sample of the output you expect would help -- so too would trimming anything extranious to the PHP itself(like the html). But, I think the issue you're running in to is any variable, like $tr_type2, is being over-writen each time you get a new

[PHP] Loop issues

2007-11-16 Thread Dan Shirah
Hello all, I am having trouble trying to figure out how I should compose this loop to give me ALL the results I want. Below are my queries. I am querying two different databases to pull in records that match the requested $id. I am then putting the result into a $variable and also counting the

Re: [PHP] Loop issues

2007-11-16 Thread Jeremy Mcentire
Yeah...see...I'm confused apparently! My while loop is getting all of the names correctly, apparently my problem is...once i get them, how do I echo each one out seperately? Based off of the print_r($cs_row) I can see all of the names. What should I be doing differently to output each

Re: [PHP] Loop issues

2007-11-16 Thread Dan Shirah
Jeremy, What you replied with is what I was also trying to get across. When I print out the array it shows that I pulled all of the names correctly. And the issue is like you stated that the $name variable is being overwritten. What I have not been able to figure out is how to get each name

Re: [PHP] Loop issues

2007-11-16 Thread Daniel Brown
On Nov 16, 2007 1:57 PM, Dan Shirah [EMAIL PROTECTED] wrote: [snip!] if($cs_num 0) { while ($cs_row = mssql_fetch_array($cs_type)) { $cs_type2 = $cs_row['request_type']; $cs_first = $cs_row['first_name']; $cs_last = $cs_row['last_name']; $cs_name = $cs_first.

Re: [PHP] Loop issues

2007-11-16 Thread Jim Lucas
Just noticed on that last one I forgot to change one variable name. the line that was this $tr_type = mssql_query($get_tr) or die(mssql_get_last_message()); change it to this $tr_type = mssql_query($SQL) or die(mssql_get_last_message()); -- Jim Lucas Some men are born to greatness, some

Re: [PHP] Loop issues

2007-11-16 Thread Jim Lucas
Dan Shirah wrote: Hello all, I am having trouble trying to figure out how I should compose this loop to give me ALL the results I want. Below are my queries. I am querying two different databases to pull in records that match the requested $id. I am then putting the result into a $variable