[b]amount of data passed thro forms..[/b]

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

[b]amount of data passed thro forms..[/b]

Post by harsha »

i need help with the amount of data passed to a MySQL DB using forms...right now the size of data chunk i pass is too less and i want to be able to pass articles together....plz help
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Sorry I'm a bit confused by your question, could you please explain what exactly you are trying to do and how would like to be able to do it.

Mac
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

passing thro forms

Post by harsha »

i scripted a php script to accept the article(which is quite big) and then i connect to the mysql db and enter another row....what happens now is that the data entered is clipped (i.e; part of the data is inserted)....i hope that helps
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

What type of field are you inserting the data into? If it's a varchar field then that will only accept 255 characters, if you need space for more you should change it to a text field.

Mac
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

its a long text field

Post by harsha »

am inserting into a long text field and face no problem when i use PHP MYadmin to do that its only when i send on the localnetwork.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

That's really strange. Why don't you post some of the code here - maybe something in there is going wrong.

Mac
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

heres the complete code...though not very neat ;)

Post by harsha »

<?php

//form variables declared as global variables
$author=$HTTP_POST_VARS['author'];
$title=$HTTP_POST_VARS['title'];
$info=$HTTP_POST_VARS['info'];
$body=$HTTP_POST_VARS['body'];
$submit=$HTTP_POST_VARS['submit'];
if($HTTP_POST_VARS['submit'])
{
$db = mysql_connect("localhost", "shadows","qwerty");
mysql_select_db("articles",$db);
$sql = "INSERT INTO artikle (author,title,info,body) VALUES ('$author','$title', '$info', '$body')";
$result = mysql_query($sql);
echo "<b>Thank you! Information entered.<b><br>";
}
else
{
?><title>^*Articles--AutoShadows v1.0*^</title>
<body bgcolor="#CCCCCC">
<form method="POST" action="auto_article.php">
Author's name:<br><input type="Text" name="author" size="30"><br>
Article's title:<br><input type="Text" name="title" size="67"><br>
Description of the Article:<br>
<textarea name="info" cols="50" rows="5">
Enter the description of the article
</textarea>
<br><br>
Article in detail:<br>
<textarea name="body" cols="50" rows="10">
Enter the description of the article
</textarea>
<br>
<input type="submit" name="submit" value="Publish Article">
<input type="reset"name="reset" value="clear all"></form>
<?
}
?>
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

have you checked the HTTP POST max size restrictions on your webserver?
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

web POST max is 8 MB

Post by harsha »

yah i checked apache's httpd conf( i guess thats right ) it says the max size for post is 8 mb
now what?
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Nice work on the bold tags in the title ;)
Image Image
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

try printing the article body to the screen at the same time as when you do the database insert, as if it were the confirmation page. At least then you will know whether it is the database chopping the data or if the full article isnt getting posted to the database. Let us know which of those options it is.
Post Reply