Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 02-05-2003, 11:17 PM   #1 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
limit on chars entered into database?

Well I thought everthing was working fine. For some reason when I tried to post news on my site it wont let me enter anything more than a couple lines.

Same with the forum.

I have it set up as message is 'text' in mysql.

am I missing something? WTF?

thanks all

-trevor <-- damn my name is showing up a lot on this forum
trevor is offline   Reply With Quote
Old 02-05-2003, 11:38 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
asking questions is good trevor .. that is what this forum is for .. it's nice that it is getting some use =)

what is the data type in mysql of the news article field?

go into phpmyadmin and edit the field where the news article is stored. the data type needs to be "Medium Text"
sde is offline   Reply With Quote
Old 02-06-2003, 07:54 AM   #3 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
hmm... im using the text datatype fine on several sites....

any reason to use medium text over text?
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 02-06-2003, 08:29 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
right, i should rephrase, ..

don't use varchar 255

my only point is that his datatype is too small.
sde is offline   Reply With Quote
Old 02-06-2003, 08:40 AM   #5 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
Quote:
I have it set up as message is 'text' in mysql.
that looks like he has it set up as 'text' not 'varchar(255)'

text should be able to hold HUGE amounts of data.

perhaps i am missing something.

maybe trevor could give us a 'desc' of his table?
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 02-06-2003, 09:35 AM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
oh, i missed that text thing =)

smalltext is equivilent to varchar(255) .. maybe that is it? we will have to hear from trevor.
sde is offline   Reply With Quote
Old 02-06-2003, 12:47 PM   #7 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
hey all,

this is how it is set up:

Field Type Attributes Null Default Extra
id int(10) UNSIGNED No auto_increment
author text Yes NULL
header text Yes NULL
date text Yes NULL
time text Yes NULL
content text Yes NULL

any suggestions?

here is the url http://65.95.241.124/ao/ try posting something big on the forum and you wil see. I think sde already tried it out.

thanks all

-Trevor
trevor is offline   Reply With Quote
Old 02-06-2003, 12:48 PM   #8 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
i didnt all line up ass well as I had hoped
trevor is offline   Reply With Quote
Old 02-06-2003, 12:57 PM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
http://www.mysql.com/doc/en/Column_types.html

there's the data types, .. and yes, text should be large enough. that is confusing, i don't know what the problem could be.
sde is offline   Reply With Quote
Old 02-06-2003, 01:32 PM   #10 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
hmmm...

I tried posting a ton of jargon (over 1500 characters) and it went through?

gotta ponder this one.
trevor is offline   Reply With Quote
Old 02-06-2003, 01:34 PM   #11 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
are there any rules for characters you cant enter into a post or anything?
trevor is offline   Reply With Quote
Old 02-06-2003, 01:50 PM   #12 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
AH HA!!

I narrowed it down.

it doesn't seem to like --> '

single quotes always give an error?!?!

ideas?
trevor is offline   Reply With Quote
Old 02-06-2003, 02:02 PM   #13 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
sql uses ' to delimit text.
in most sql implementations, a single quote is escaped with another single quote. ex:

select * from users where name='name with a '' single quote'

mysql uses c-style escape codes, a ' is escaped with a leading backslash (\)

select * from users where name='name with a \' single quote'

note that if you have php's magic_quote_escape (i think that's what it's called) environment variable turned on, php will automatically do the escaping for you for any post and get params.
joe_bruin is offline   Reply With Quote
Old 02-06-2003, 02:38 PM   #14 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
how do you turn that on?
trevor is offline   Reply With Quote
Old 02-06-2003, 02:54 PM   #15 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
n/m that was it, i fixed it. magic_quotes was turned off.

THANKS ALL!!
trevor is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't see MySql database records in Mozilla monicao PHP 3 05-02-2004 06:19 PM
Methods of moving a database... DarkTwilkitri PHP 8 11-19-2003 06:02 AM
Database Users Keen on Linux 2.6 Kernel sde Linux / BSD / OS X 0 05-19-2003 03:01 PM
Array of chars of chars of, wait, uh... anon Standard C, C++ 15 01-11-2003 05:15 PM


All times are GMT -8. The time now is 08:04 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting