Re: [PHP-DB] my sql text query

2001-03-10 Thread Phil Driscoll

Nope, you change the field to not null then it won't allow null values in
the database. Since the data already has null values, the Alter Table would
probably fail.

I should have been clearer -  change the text field to non-null - this will
cause the null entries to become empty strings (and hence your
mysql_fetch_array calls will have an entry for that field containing an
entry string) and then back again to null. I've just tried it on my machine
and it works a treat.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] my sql text query

2001-03-09 Thread Steve Brett

hi,

i'm currently writing an e-commerse site using php for the shopping cart
stuff and mysql as the db.

i've got a text filed of type text that holds descriptions for the items but
only need to display it if a description exists, so many of the fields are
null. the field was added to the table when the table was already populated
and when  try to read it i get errors saying the index is not defined ...

if i change it to varchar(255) there is no problem ?

can anyone help ?

Steve Brett 
Internal Development 
EMIS Ltd. 
"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."
Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] my sql text query

2001-03-09 Thread Cal Evans

Nope, you change the field to not null then it won't allow null values in
the database. Since the data already has null values, the Alter Table would
probably fail.

I'm still trying to figure out what any of this has to do with an index? Do
you have an index on this description field?

Cal
http://www.calevans.com


-Original Message-
From: Phil Driscoll [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 7:59 AM
To: Steve Brett; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] my sql text query


Good heavens, another PHP developer in Leeds:)

I think (I haven't tried this!) you could change the field type to
not-null - then your array should get populated with empty strings for any
records where this field is not set.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]