473,909 Members | 2,242 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 2463
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
15440
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
4314
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 that I need to keep even if they don't have any child records in the MANY table. Below I created...
16
17051
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 IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
16
3887
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 couldn't find anything. the context: we have some java folk who like to parametize/
3
3466
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 database. Can you tell me what am I doing wrong?
20
18403
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
7374
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 this restriction. Code below pasted to QueryAnalyser shows that I can not supply dummy values for...
1
6218
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 a insert query on the statement. It triggers both insert and update trigger at the same time and...
4
4877
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 datagridview I use the following sqlDataAdapter code to update the server table - which works OK when...
0
2295
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 trg_ContactAddress_Audit ON Address FOR DELETE, INSERT, UPDATE AS
0
11348
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11052
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10540
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9727
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8099
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3359
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.