You are here: Re: [PHP] Re: novice: char to varchar « PHP « IT news, forums, messages
Re: [PHP] Re: novice: char to varchar

Posted by "Satyam" on 10/20/96 11:16

My guess is that the solution is that MySql, though it supports the syntax
for standard SQL and thus takes char and varchar, it actually doesn't have a
specific storage type for each, all chars are stored in varchar fields, just
as all boolean or bit fields are stored in integer fields.

Though this would be a quite acceptable optimization on the part of the SQL
engine, the problem is that it reports what the optimization did, not what
you asked for. I mean, if I ask for char, report to me a char, no matter
what is it that you stored it in.

I actually reported this as a 'feature request' in the MySql site:
http://bugs.mysql.com/bug.php?id=3350. I first discovered it when I
migrated a 'form creator' which I made years ago and is already in its third
incarnation of language/database, which makes forms based on the structure
of a database table. Depending on the field type it creates an appropriate
input field with validation, normal input for char or varchar fields,
textareas if the field length is longer than a configurable size, calendar
controls for dates, <select> listboxes if you indicate a lookup table and,
checkboxes if the field is boolean. The problem is that MySql does not
report booleans as such but as the storage type, which might be different
from the declared type, so I didn't get my checkboxes. So I am forced to
explicitly declare to the form creator which fields are actually boolean
since it cannot pick it from the database structure.

Satyam







"Kim Madsen" <km@comx.dk> wrote in message
news:15653CE98281AD4FBD7F70BCEE3666E5313938@comxexch01.comx.local...
> -----Original Message-----
> From: tony yau [mailto:tony.yau@emigen.co.uk]
> Sent: Wednesday, May 18, 2005 9:03 PM

> found the answer sorry about this

But You don΄t wanna share the solution with the rest of the class?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация