A MySQL question - Select usage

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
User avatar
fallen
Forum Newbie
Posts: 7
Joined: Wed Aug 27, 2003 7:46 am
Location: UK

A MySQL question - Select usage

Post by fallen »

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!
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

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?
User avatar
fallen
Forum Newbie
Posts: 7
Joined: Wed Aug 27, 2003 7:46 am
Location: UK

Post by fallen »

Cheers JAM

Basically I'm checking the contents of the db using command line commands direct to mysql, I can blank the text fields

Code: Select all

update set text_field='';
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.
User avatar
fallen
Forum Newbie
Posts: 7
Joined: Wed Aug 27, 2003 7:46 am
Location: UK

Post by fallen »

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='';
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

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.
User avatar
fallen
Forum Newbie
Posts: 7
Joined: Wed Aug 27, 2003 7:46 am
Location: UK

Post by fallen »

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.
User avatar
Orkan
Forum Commoner
Posts: 32
Joined: Sun Aug 24, 2003 9:07 am
Location: Ukraine
Contact:

Post by Orkan »

I've searched on http://www.mysql.com in documentation... They don't mention any posibility of selecting all columns except one...
Post Reply