473,395 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to enter the text file in to LongBLOB field.

HI ALL,

I am new bie to mysql...I have 100 files as text files and each text file are having minimum 25 lines.I want to enter all the files in to Mysql DB.

My query is, In mysql table, i have a columns like pid(PRIMARY KEY),content(LONGBLOB).
In table, Pid has entries like p1,p2,p3.....
Now in a directory, i have text files like p1.txt,p2.txt,p3.txt.....
I want to upload the text files into content(LONGBLOB) column field, if the PID and the textfile names are same.

CAN ANYONE HELP ME TO UPLOAD THE TEXT FILES..

Please it's urgent.

Thanks in advance...
Jan 19 '07 #1
3 2861
ronverdonk
4,258 Expert 4TB
Do these entries in the database already exist? I mean do you have rows reserved with the key pid (file_name) already in or do you want to create the pid(..) while uploading? The former requires an UPDATE, the latter an INSERT.

You must have some coding done before we can help you. A hint is:

Expand|Select|Wrap|Line Numbers
  1. open MySQL connection
  2. Do until all files processed:
  3. -  get next text file name from array
  4. -  read textfile into one php variable
  5. -  construct the UPDATE or INSERT SQL statement
  6. -  execute the MySQL statement
  7. End Do;
Ronald :cool:
Jan 19 '07 #2
No, we have pid column field already...

what we want to do is.. we should match the pid with the text files and if it is matching ...then we need to upload the the file in the content (longblob)field automatically

I dont want to enter manually...
Jan 19 '07 #3
ronverdonk
4,258 Expert 4TB
So: go ahead, you know now what the process should be. Start coding.

Ronald :cool:
Jan 19 '07 #4

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

Similar topics

1
by: Jacky Luk | last post by:
select * from s_proc where content = 'asiufhasiu' the scrambling field was copied from the control panel of the binary field. Is it possible to do straight query on the control panel directly...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
1
by: Davide | last post by:
Perche' non riesco ad inserire immagini opiu' grandi di 1Mb in un campo LONGBLOB? Ha forse il limite di 1Mb il campo LONGBLOB? Se si, posso modificare tale limite? Per le immagini inferiori a...
4
by: Simon Wigzell | last post by:
Is there a way to prevent a form submitting when you press enter on a text field? Some people press enter when they finish typing in a text field out of habit I guess unconcsciously thinking it...
10
by: Deano | last post by:
I think that just about sums it up. Is there a fix/workaround for this?It's quite annoying behaviour and not user-friendly.thanksMartin
3
by: Susan | last post by:
AccessXP When I use the wizard to create a form, all the textboxes are created with the Enter Key Behaviour of "New Line In Field". When I create the form manually the Enter Key Behaviour is...
2
by: bullshark | last post by:
VSN03:C# Create a C# Windows Form project. Add two TextBox controls. From the Properties of each, add an Enter Event handler. In the generated Enter Event Handlers (textBox1_Enter &...
0
by: Mike Kingscott | last post by:
Totally hacked off here. I've written a user control that contains a text box, a required field validator and a button (these being the cornerstone of a search facility), all as ASP.Net server...
8
by: Jeff | last post by:
A client wants a press of the Enter key in a field on a continuous form to grab the value of that field from the previous record. But if they have typed a value and then hit Enter it shouldn't. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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...

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.