Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Mysql db doesnt save text if its too long

0

61 views

My problem is pretty much decribed with the title! I have this code that inserts data to the db:

<?php
require_once 'connection.php';
$pName = $_POST['scriptName'];
$pCode = $_POST['code'];
$group = $_POST['group'];
$descri = $_POST['descr'];
$lang = $_POST['lang'];
$date = date("Y-m-d");
$updateq = "INSERT INTO code_tb (id, Script_Name, Description, Code, Language, Date) VALUES ('NULL', '$pName','$descri', '$pCode', '$lang', '$date')";
$result=mysql_query($updateq);
echo "$pName . $pCode . $group . $descri . $lang . $date";
?>

The Code field in my database is of type text.

When the code is too long it doesn't get saved in the db and I am not getting any error at all! If i shorten up the text string it works!

Might this be a stupid beginner mistake?

asked June 25, 2011 1:04 pm CDT
posted via StackOverflow

1 Answer

0
 

AFAIK the text should get truncated if longer than allowed. Can you post an example when it doesn't work?

answered June 25, 2011 1:25 pm CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions