solution-digest

From: Date: Tue, 31 Oct 2000 13:46:00 +0000
Subject: solution-digest
Groups: php.db 
Request: Send a blank email to php-db+get-4091@lists.php.net to get a copy of this message
Hi, first of all, I've received some mail about yesterday's exec and popen suggests for directory listing. The easyest method is to use opendir and readdir. Sorry I did not knew these. However, keep in mind exec and popen since you may need it someday - and do not fear using them, of course, if there is a reason to do so (: >From: simon.pospisil@fastwebmedia.co.uk >Date: Tue, 31 Oct 2000 17:00:06 +0000 >Subject: Writing more than 4000 chars to database. > >Hello, > >I have a problem writing more than ~4000 chars to my database, to a >field defined as VARCHAR2. It won't accept any more than this. I've >read something about BLOBS, LOBS, CLOBS but I'm unsure as to how they >work and how to use them. Can you advise of the best way to solve this >problem? (As you've probably guessed I'm something of a newbie!). > >Many thanks, > >Simon Pospisil What type of database are you using? If you use mysql, simply use blobs - you can change the type of a column any time. However, it does not seem to me a mysql database due to VARCHAR2. RTFM will help for sure, look for a variable which can store up to 65536 chars - your system should have something like that. -o- >From: "Nicolas Raitman" <new_world@radar.com.ar> >Date: Tue, 31 Oct 2000 21:16:20 -0300 >Subject: MySQl and PostgreSQL > >Is it ok to do the following in any of the databases Systems mentioned in >the Subject: > >create table docs ( >id integer unsigned not null autoincrement primary key, >........... >) I mean, is ok the way I created the primary key, because when I try to do >that I get an error... > >Thanks a lot, >Nicolas I do not know pgsql but in mysql, your query should be written something like this: create table docs (id int(32) unsigned not null auto_increment primary key, ... notice the underline and the usage of int(x) telling on how many bits the number will be stored. With 32 bits, you can have id having value of 0...4294967295 which should be enough for any tables. Usually int(16) should be enough too.

« previous php.db (#4091) next »