473,557 Members | 2,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert/Update

8 New Member
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($in sert);

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

Anyone could please help? Thanks!
Feb 26 '08 #1
6 2452
ck9663
2,878 Recognized Expert Specialist
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($in sert);

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

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 New Member
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 Recognized Expert Specialist
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($in sert);

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

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 New Member
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 Recognized Expert Specialist
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 New Member
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

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

Similar topics

1
15395
by: shottarum | last post by:
I currently have 2 tables as follows: CREATE TABLE . ( mhan8 int, mhac02 varchar(5), mhmot varchar(5), mhupmj int )
14
4273
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to salvage the records from the many table and without going into detail, one of the reasons I can't do the opposite as there are records in the ONE table...
16
16983
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then...
16
3856
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the table, or perhaps bytes, being updated where the engine just decides, screw it, i'll just make a new one. surfed this group and google, but...
3
3432
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all the necessary records in it when testing it. I get the error "No value given for one or more required parameters." when I try to update the...
20
18319
by: Mark Harrison | last post by:
So I have some data that I want to put into a table. If the row already exists (as defined by the primary key), I would like to update the row. Otherwise, I would like to insert the row. I've been doing something like delete from foo where name = 'xx'; insert into foo values('xx',1,2,...);
3
7360
by: V T | last post by:
Hello all, SQL Server 2000 documentation http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part10/c3761.mspx states that if view is using "NOT NULL" columns of a base table, then insert/update performed on a view must provide dummy values for those columns, and code of the trigger should ignore them. But I cannot reproduce...
1
6193
by: abhi81 | last post by:
Hello All, I have a table on which I have created a insert,Update and a Delete trigger. All these triggers write a entry to another audit table with the unique key for each table and the timestamp. Insert and Update trigger work fine when i have only one of them defined. However when I have all the 3 triggers in place and when i try to fire...
4
4845
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a sql DataAdapter (da) da.SelectCommand.CommandText = "Select * from Servertbl1" da.Fill(ds, "tbl1") so far, so good. If I add a row to the...
0
2276
by: magnolia | last post by:
i created a trigger that will record the changes made to a table .everything works fine except the insert query.whenerever i try to insert a record it fires insert and update triger at the same time which means i hav 2 record for every insert operation. any help appreciated. thank u herez teh code i tried. ALTER TRIGGER...
0
7549
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7830
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6180
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5454
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.