Re: Newbie back for more

From: Date: Thu, 19 Apr 2001 13:19:08 +0000
Subject: Re: Newbie back for more
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-6869@lists.php.net to get a copy of this message
Hi, for TEXT you don't specify a length. TINYTEXT A BLOB or TEXT column with a maximum length of 255 (2^8 - 1) characters. TEXT A BLOB or TEXT column with a maximum length of 65535 (2^16 - 1) characters. MEDIUMTEXT A BLOB or TEXT column with a maximum length of 16777215 (2^24 - 1) characters. LONGTEXT A BLOB or TEXT column with a maximum length of 4294967295 (2^32 - 1) characters. If the problem still occurs, output the whole query and post it. Johannes ""r.gelstharp"" <r.gelstharp@ntlworld.com> schrieb im Newsbeitrag news:9bmks1$7re$1@toye.p.sourceforge.net... > I think I'm a little too close to the problem to see it properly, but > there's something wrong with my SQL syntax in this query I'm trying to > create. > > Readers of Julie Meroni's PHP Essentials will recognise it. > > <?php > $sql = "CREATE TABLE $table_name ("; > > for ($i = 0; $i < count($field_name); $i++) > { > $sql .= "$field_name[$i] $field_type[$i]"; > > if ($field_length[$i] != "") > { > $sql .= " ($field_length[$i]),"; > }//end if > else > { > $sql .= ","; > }//end else > }//end for > > $sql = substr($sql, 0, -1); > > $sql .= ");"; > > It gives me this error > > You have an error in your SQL syntax near '(50),product_price float > (10),product_category text (50),product_picture text (5' at line 1 > > Is there like an upper limit on the number of characters you can have in a > SQL statement? > > All help is greatly appreciated! > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.windows (#6869) next »