[PHP-DB] Missing Data in Columns
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
Re: [PHP-DB] Missing Data in Columns
snip Any ideas? /snip 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
Re: [PHP-DB] Missing Data in Columns
On Wed, 10 Dec 2003 16:21:39 -0600, Matt Matijevich [EMAIL PROTECTED] wrote: snip Any ideas? /snip 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 table width='75%' border='1' cellspacing='0' cellpadding='0' align='center' bgcolor='#99'\n; echo tr\n; echo tddiv align='center'font size='3'bRepresentative /b/font/div/td\n; echo tddiv align='center'font size='3'bParty a href='108thfirst.php?sort_field=Partysort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bState a href='108thfirst.php?sort_field=State, CDsort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bDistrict /b/font/div/td\n; echo tddiv align='center'font size='3'bVote a href='108thfirst.php?sort_field=hr2passage.passagesort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bVote a href='108thfirst.php?sort_field=estatetaxrepeal.passagesort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bVote a href='108thfirst.php?sort_field=headstartvote444.votesort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bVote a href='108thfirst.php?sort_field=hudappropsvote453.votesort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bVote a href='108thfirst.php?sort_field=energyrollcall630.votesort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo tddiv align='center'font size='3'bVote a href='108thfirst.php?sort_field=medicarerollcall669.votesort_order=asc' target='_self'font size='2'Sort/a /b/font/div/td\n; echo /tr\n; # write out each row while ($row = mysql_fetch_assoc ($data_set)) { echo tr\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
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