Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text area and PHP 1

Status
Not open for further replies.

timgerr

IS-IT--Management
Joined
Jan 22, 2004
Messages
364
Location
US
I have a text area that I am trying to insert about 63 lines of text. This is PHP front end with a mysql backend. I am putting in set lists into the database and I cannot enter all the data. I am wondering what limitations php might have with inserting text into a mysql database.
Here is the php layout
Code:
+-------------+----------
| Field      Type        |
+-------------+----------
| ID         int(11)     
| colBand    varchar(50) 
| colShow    varchar(50) 
| colSet1    longtext    
| colSet2    longtext    
| colSet3    longtext    
| colSet4    longtext    
| colShowInfolongtext
Here is the php code.
Code:
<html>
<head>
<meta name="GENERATOR" content="SAPIEN Technologies PrimalScript 3.1">
<title>Document Title</title>
</head>
<body>

<form action="setlist.php">
<table>
<tr><td style="font-weight:bold">Band</td>
<td><input type="text" name="Band"></td>
</tr>

<tr><td style="font-weight:bold">Show</td>
<td><input type="text" name="Show"></td>
</tr>
</table> 
SET1<textarea name="set1" STYLE="background-color: #E6E6FA;" rows="10" cols="80"></textarea> <br>
SET2<textarea name="set2" STYLE="background-color: #E6E6FA;" rows="10" cols="80"></textarea> <br>
SET3<textarea name="set3" STYLE="background-color: #E6E6FA;" rows="10" cols="80"></textarea> <br>
SET4<textarea name="set4" STYLE="background-color: #E6E6FA;" rows="10" cols="80"></textarea> <br>
Info<textarea name="info" STYLE="background-color: #E6E6FA;" rows="10" cols="80"></textarea> <br>
<input type="submit">
</form>

<?
include('data.php'); 	  //Database information

$band = $HTTP_GET_VARS['Band'];
$show = $HTTP_GET_VARS['Show'];
$set1 = $HTTP_GET_VARS['set1'];
$set2 = $HTTP_GET_VARS['set2'];
$set3 = $HTTP_GET_VARS['set3'];
$set4 = $HTTP_GET_VARS['set4'];
$info = $HTTP_GET_VARS['info'];

echo $band  . "<BR>"; 
echo $show  . "<BR>";   
echo $set1	.  "<BR>";
echo $set2	.  "<BR>";
echo $set3	.  "<BR>";
echo $set4	.  "<BR>";
echo $info  . "<BR>";

//createing the sql query
$query = "insert into tblinfo (colBand, colShow, colset1, colset2, colset3, colset4, colShowinfo) 
		values ('$band', '$show', '$set1', '$set2', '$set3', '$set4', '$info')";
//running the query
mysql_query($query) or die("sql insert failed");




 mysql_close($connection);
?>
</body>
</html>
Thanks

-How important does a person have to be before they are considered assissinated instead of just murdered?
 
If need be I can post the text file.

-How important does a person have to be before they are considered assissinated instead of just murdered?
 
Are you getting any errors?

Bastien

Cat, the other other white meat
 
No, when I hit submit nothing happends. I have to then delete some of the text out.


-How important does a person have to be before they are considered assissinated instead of just murdered?
 
What errors are you getting? What version of PHP/MySql?
What OS?

Off the top of my head, I would use 'Method="POST"' on your form and get the values with $_POST['var']

On you "die" function print out mysql_error() ... this will give you a better handle on what's going on.

You may have to escape any quotes in your input.

Ken
 
That was it, once I used the post method everything worked fine. Thanks.
Timgerr

-How important does a person have to be before they are considered assissinated instead of just murdered?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top