Re: [PHP-DB] Missing Data in Columns

2003-12-10 Thread George Patterson
On Wed, 10 Dec 2003 17:10:46 -0500
Ken Colburn <[EMAIL PROTECTED]> wrote:

> Only six of ten columns in a php table show up on the web.  I've been 
> using a standard format for many months now and the only difference
> here is that I'm drawing on more (seven) tables.  Even more curious,
[snip]

> 
> Any ideas?
> 

just one, your column names are not unique enough... 
> Ken
> 
> http://congress.techpolitics.org/108thfirst.php
> 
> # query mysql to get data
> $get_data_query = "select fullhouse2.Representative, fullhouse2.Party,
> medicarerollcall669.State, medicarerollcall669.CD, hr2passage.passage,
> 
> estatetaxrepeal.passage,
> headstartvote444.vote, hudappropsvote453.vote, energyrollcall630.vote,
> 
> medicarerollcall669.vote
>  from fullhouse2, medicarerollcall669, hr2passage, estatetaxrepeal, 
> headstartvote444,
> hudappropsvote453, energyrollcall630
> 
> where
> 

PHP will treat headstartvote444.vote, hudappropsvote453.vote,
energyrollcall630.vote, medicarerollcall669.vote as the same column name
called vote. You have made the same clasic mistake with passage (and
perhaps other columns...

Try this instead... 

select fullhouse2.Representative, fullhouse2.Party,
medicarerollcall669.State as medicare_State, medicarerollcall669.CD as
medicare_CD, hr2passage.passage as hr_passage, estatetaxrepeal.passage
as estrate_passage, headstartvote444.vote as head_vote,
hudappropsvote453.vote as hud_vote, energyrollcall630.vote as energy
vote, medicarerollcall669.vote as medicare_vote from fullhouse2,
medicarerollcall669, hr2passage, estatetaxrepeal,  headstartvote444,
 hudappropsvote453, energyrollcall630


Regards
George Patterson

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Missing Data in Columns

2003-12-10 Thread Ken Colburn
On Wed, 10 Dec 2003 16:21:39 -0600, Matt Matijevich 
<[EMAIL PROTECTED]> wrote:

Any ideas?

could you post the code you use to output each table row?
***

Here's the code requested along with column headings and sort code:

# write out table heading
echo "\n";
echo "\n";
echo "Representative 
\n";
echo "Party Sort \n";
echo "State Sort \n";
echo "District 
\n";
echo "Vote Sort \n";
echo "Vote Sort \n";
echo "Vote Sort \n";
echo "Vote Sort \n";
echo "Vote Sort \n";
echo "Vote Sort \n";
echo "\n";

# write out each row
while ($row = mysql_fetch_assoc ($data_set))
{
echo "\n";
foreach (array_keys($row) as $item)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Missing Data in Columns

2003-12-10 Thread Matt Matijevich

Any ideas?


could you post the code you use to output each table row?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Missing Data in Columns

2003-12-10 Thread Ken Colburn
Only six of ten columns in a php table show up on the web.  I've been 
using a standard format for many months now and the only difference here 
is that I'm drawing on more (seven) tables.  Even more curious, running 
the "select" and "where" statements in mysql produces the full table. 
Also, clicking on "Sort" in a blank "Vote" column rearranges the visible 
vote columns which suggests sorting based on the invisible column.  Worse 
(which I won't try to solve here), when I delete some "select" statements 
the table disappears.

The link and "select" statement are shown below (I won't copy the 
extensive "where" statement, but the table didn't appear when that was 
wrong).

Any ideas?

Ken

http://congress.techpolitics.org/108thfirst.php

# query mysql to get data
$get_data_query = "select fullhouse2.Representative, fullhouse2.Party,
medicarerollcall669.State, medicarerollcall669.CD, hr2passage.passage, 
estatetaxrepeal.passage,
headstartvote444.vote, hudappropsvote453.vote, energyrollcall630.vote, 
medicarerollcall669.vote
from fullhouse2, medicarerollcall669, hr2passage, estatetaxrepeal, 
headstartvote444,
hudappropsvote453, energyrollcall630

where

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php