empty column returned but it is not empty??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

empty column returned but it is not empty??

Post by Extremest »

I am doing a select * on my table and for some reason everything is right except for one column comes up emtpy. I have checked and it is full. Not sure if maybe it is because of what is there here is what is in the column. could it be the <> messing it up. I tried a foreach loop to go through it and everything shows up except that field value from the query.

<HVXZf.37757$Nh7.22580@newsfe4-win.ntli.net>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Can you post some code?
Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

Post by Extremest »

Here is the code just to test the columns.

Code: Select all

$q = "select * from `$group` where subject like '$subject%'";
$result = mysql_query($q,$mysql) or die(mysql_error().$q);
while ($row = mysql_fetch_assoc($result)) {
foreach($row as $key => $value)
	echo $key."---".$value."\n";
the key is right but the value is empty for the column msg_id with the above value. All the rest of the columns come through fine.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

What does that test output? I am drawing a blank as to why a known column name would show empty even though when looking at the table it has values. Unless there is an overwrite taking place somewhere.
Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

Post by Extremest »

here is the output that I am seeing from that.
numb---6964292 subject---ATTN: bjthedj - "mm6328-08 - tambourine man - dylan, bob.zip" yEnc (5/9) from---maria&bill@workagain.lol (maria & bill) date---Sat, 08 Apr 2006 23:44:39 GMT msg_id--- bytes---661224 groups---alt.binaries.sounds.karaoke indexed---0
here is it cleaned up with some <br's>.
numb---6964292
subject---ATTN: bjthedj - "mm6328-08 - tambourine man - dylan, bob.zip" yEnc (5/9)
from---maria&bill@workagain.lol (maria & bill)
date---Sat, 08 Apr 2006 23:44:39 GMT
msg_id---
bytes---661224
groups---alt.binaries.sounds.karaoke
indexed---0
And here is the same query in query browser and it's output.
6964292, 'ATTN: bjthedj - "mm6328-08 - tambourine man - dylan, bob.zip" yEnc (5/9)', 'maria&bill@workagain.lol (maria & bill)', 'Sat, 08 Apr 2006 23:44:39 GMT', '<HVXZf.37757$Nh7.22580@newsfe4-win.ntli.net>', '661224', 'alt.binaries.sounds.karaoke', 0
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

When you run the script, and do a view source, do you see the output that is NOT showing in the query output? I only ask that because there is a chance that the browser may be interpreting '<HVXZf.37757$Nh7.22580@newsfe4-win.ntli.net>' as an HTML tag (because of the opening and closing tags). Just a thought.
Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

Post by Extremest »

ok not sure where my brain was there. That is the problem.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

It was in the same place as BigAbe's.
Post Reply