Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
fallen
Forum Newbie
Posts: 7 Joined: Wed Aug 27, 2003 7:46 am
Location: UK
Post
by fallen » Thu Aug 28, 2003 9:15 am
Hi all,
I just wanted to know if there was a way of requesting all the fields expect a given one when using a select.
I have one huge text field which makes it difficult to view the other data properly whilst debugging.
So is it possible to write
Code: Select all
select * apart from text_field from some_db
Or simliar.
If this is in the MySQL manual 'select' page please feel free to slap me!
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Thu Aug 28, 2003 9:24 am
No, I dont think so.
How are you debugging it? I had a similiar problem, but solved it with something similiar to this.
I used print_r() to print out the array in a loop. Before the print_r() was run, i set the blob field to '', example:
Code: Select all
while($row = mysql_fetch_array($result)) {
$row['text'] = '';
print_r($row);
}
Hence the text, was 'emptied'. Perhaps it's a workaround for you also?
fallen
Forum Newbie
Posts: 7 Joined: Wed Aug 27, 2003 7:46 am
Location: UK
Post
by fallen » Thu Aug 28, 2003 9:31 am
Cheers JAM
Basically I'm checking the contents of the db using command line commands direct to mysql, I can blank the text fields
does it in two shakes of a lambs tail but I'm trying to avoid that. If I wanted to work at it I'd type in a long list of all the other field.
I'm being lazy and so want a really simple answer which may well be "No do it the long way you lazy toad", or hopefully will be use this syntax go.
fallen
Forum Newbie
Posts: 7 Joined: Wed Aug 27, 2003 7:46 am
Location: UK
Post
by fallen » Thu Aug 28, 2003 9:32 am
Sorry missed the tbl_name out of the code in the previous. It should have been.
Code: Select all
update tbl_name set text_field='';
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Thu Aug 28, 2003 9:37 am
Aha, directly in the db. Thats a different story =)
I recommend you to look at the usage of temporary tables, just perhaps, you might be able to find something useful there.
But I'm not 100% sure that there is no way, so those with more experience have to answer.
Good luck tho.
fallen
Forum Newbie
Posts: 7 Joined: Wed Aug 27, 2003 7:46 am
Location: UK
Post
by fallen » Thu Aug 28, 2003 9:40 am
Same situation here, never seen a way to do it just thought it would be useful here. If anyone is 100% sure I'm just being lazy and asking the impossible please tell me. This query borders on idle curiosity.
Orkan
Forum Commoner
Posts: 32 Joined: Sun Aug 24, 2003 9:07 am
Location: Ukraine
Contact:
Post
by Orkan » Thu Aug 28, 2003 10:00 am
I've searched on
http://www.mysql.com in documentation... They don't mention any posibility of selecting all columns except one...