472,143 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

Insert/Update

8
Hello everyone! I am using PHP. I need to save data from <textarea> to MSSQL. I want that user will copy and paste data from MS Excel. I used the form method=Post. My data type is text with length 7000

My problems are:

1) Not all data posted is saved.
2) When I try to edit the data through <textarea> then submit, data on the last row portion is lost. I can't trace why coz when I look in the database LongText is only I could see. I also tried viewing thru SQL Analyzer but only the first row of the data can be viewed.
3) I tried searching and met the sp_tableoption , textinrow and @ptr. I dont understand how to use it.

My codes for saving:
$insert="INSERT INTO Itb (itbNo, myLongText) VALUES ('$itbNo', '$myLongText')";
$result= mssql_query($insert);

My codes for updating:
$update="UPDATE Itb SET myLongText='$myLongText' where itbNo = '$itbNo'";
$result = mssql_query($update);

Anyone could please help? Thanks!
Feb 26 '08 #1
6 2358
ck9663
2,878 Expert 2GB
Hello everyone! I am using PHP. I need to save data from <textarea> to MSSQL. I want that user will copy and paste data from MS Excel. I used the form method=Post. My data type is text with length 7000

My problems are:

1) Not all data posted is saved.
2) When I try to edit the data through <textarea> then submit, data on the last row portion is lost. I can't trace why coz when I look in the database LongText is only I could see. I also tried viewing thru SQL Analyzer but only the first row of the data can be viewed.
3) I tried searching and met the sp_tableoption , textinrow and @ptr. I dont understand how to use it.

My codes for saving:
$insert="INSERT INTO Itb (itbNo, myLongText) VALUES ('$itbNo', '$myLongText')";
$result= mssql_query($insert);

My codes for updating:
$update="UPDATE Itb SET myLongText='$myLongText' where itbNo = '$itbNo'";
$result = mssql_query($update);

Anyone could please help? Thanks!
Check the structure of your table. What's the data type of column "myLongText"? Is it big enough to hold your entire text?

-- CK
Feb 26 '08 #2
emm
8
Check the structure of your table. What's the data type of column "myLongText"? Is it big enough to hold your entire text?

-- CK
Hi! The data type of "myLongText" is text and its Length is 7000. Enough to hold the text, i guess.

I am also wondering why the data specifically on the last rows is lost. What I did was retrieve the data then save it. But when I retrieve again some data is lost.

Help on this pls.
Feb 27 '08 #3
ck9663
2,878 Expert 2GB
Hello everyone! I am using PHP. I need to save data from <textarea> to MSSQL. I want that user will copy and paste data from MS Excel. I used the form method=Post. My data type is text with length 7000

My problems are:

1) Not all data posted is saved.
2) When I try to edit the data through <textarea> then submit, data on the last row portion is lost. I can't trace why coz when I look in the database LongText is only I could see. I also tried viewing thru SQL Analyzer but only the first row of the data can be viewed.
3) I tried searching and met the sp_tableoption , textinrow and @ptr. I dont understand how to use it.

My codes for saving:
$insert="INSERT INTO Itb (itbNo, myLongText) VALUES ('$itbNo', '$myLongText')";
$result= mssql_query($insert);

My codes for updating:
$update="UPDATE Itb SET myLongText='$myLongText' where itbNo = '$itbNo'";
$result = mssql_query($update);

Anyone could please help? Thanks!
Try to display the value of your $insert. Copy and paste it on Query Analyzer. Let's go from there.

-- CK
Feb 27 '08 #4
emm
8
Try to display the value of your $insert. Copy and paste it on Query Analyzer. Let's go from there.

-- CK
Hi! Yes, I copied and paste it on Query Analyzer.. and the query is successful. I dont know where to go from there. :-) I am stuck.
Feb 29 '08 #5
ck9663
2,878 Expert 2GB
Then it seems the problem happens when the data is being transmitted to sql-server, since your query is built properly, I'm not much of a PHP programmer, so I can figure out if your problem is in PHP or not.

Sorry, not much help.

-- CK
Feb 29 '08 #6
emm
8
Yehey! Guyz, I got the answer on my problem why some data rows are missing even my SQL is correct. In my php.ini, I changed the default to maximum. :-)

; Valid range 0 - 2147483647. Default = 4096.
mssql.textlimit = 2147483647

; Valid range 0 - 2147483647. Default = 4096.
mssql.textsize = 2147483647

Thanks everyone!
Feb 29 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

16 posts views Thread by Philip Boonzaaier | last post: by
16 posts views Thread by robert | last post: by
20 posts views Thread by Mark Harrison | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.