Inserting Data Into Mysql Database
i need to insert data from a txt file that is updating continously, select those info that i need by line, and after that adding them,
i don't think that can be done in mysql; i've foud another program that i've made to read the file and select them, but now i don't know how to insert them in a data base, except php is there another program that can insert data into a mysql database?
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Inserting VB Data Into MySQL Using Ado
I am trying to insert some data into a MySQL db, with Visual Basic by using ADO. I can select data without a problem using adorecordset.open, to insert would I use adorecordset.addnew? if anybody has done this and has a sample script I would be very happy to check it out.
View Replies !
View Related
Php Mysql Not Inserting Data, No Rerror Msg.
On development machine is a winXP and server for test is linux RHEL. I have a code that gets data from a form and insert into a table. -- $query_po_h = "INSERT INTO po_header (ponum, whs, extref, status, supplier, blkord, podate, remrk1, remrk2, remrk3) VALUES ('$ponum_t', '$whs', '$extref', 10, '$supplier', '$blkord', now(), '$remrk1', '$remrk2', '$remrk3') "; $rs_po_h = $db->Execute($query_po_h) or die("Error in query: $query_po_h. " . $db->ErrorMsg()); -- The problem here is it works on the development machine but doesn't work on the server. It is not generating error message at all. And only this particular query is not working. Other queries with the mysql database be it insert, update, delete or select works fine. Any idea why php-mysql will not work and still don't generate any error message?
View Replies !
View Related
Inserting Time Data Into MYSQL
I'm trying to insert an assortment of data into a mysql database. Although I'm having problems when inserting fields with time information. Firstly, it's outputting it as HH:MM:SS and I need it to output as HH:MM. It's also defaulting as "00:00:00" even if I leave it blank. I've set it up as TIME and set the default as blank and NULL ...
View Replies !
View Related
Inserting Large Amounts Of Data Into Mysql
I have a whole bunch of numbers and state, county, city, etc. data that i'm trying to load into a database for a demographics website. The data is all in excel currently so I could easily copy and paste it to a text file or another medium if necessary but I'm wondering what the quickest and most efficient way to get it all entered into mysql is.
View Replies !
View Related
Inserting Into MySQL Database
I have a MySQL database through my hosting company and have written an upload page for users to input information into a html form and submit it to my database. This works fine for short little answers (like "Test"), but when I want to put sentences in or anything longer than a couple of words, it doesn't insert itself into the database. I don't get any errors, it just doesn't do anything. I've tried changing the fields to mediumtext and longtext and still getting the same problems.
View Replies !
View Related
Inserting Blob Into MySQL Database
I'm facing a strange problem when I try to insert a blob in my SQL database. I'm implementing a web application using Struts and hibernate and My SQL for the database. The application runs fine when I insert the blob (which is an image in my case). However, I'm unable to see the row in the table when I go to MySQL and do a "select" statement. All I get are a bunch of dashed lines that go on forever. I simply followed instructions given in a struts and hibernate tutorial to insert blob data and I don't get any errors when I run the application. Following are the details: Code:
View Replies !
View Related
Inserting Image Into MySQL Database
I understand that this is not the best way to use images and databases, but that is how the database is designes. So that is how i have to do it. when i try it with the syntax: INSERT INTO image_source(id, file_name, mime_type, image_data) VALUES (13, 's620.jpg', 'image/gif', 'C:Inetpubwwwroots620.jpg') I dont get any errors, but it doesnt insert the image either... The image_data coulmn is of type blob as it is supposed to be, so im not sure what is going wrong here...
View Replies !
View Related
Inserting Special Characters Into MySQL Database
I am trying to add products to one of my clients' online shops and in the past it's all gone fine. I have a PHP script which handles a CSV file upload, digests the rows and inserts the data into a number of tables. The upload I did today seemed fine until I realised that certain products have appeared with a ? in the name or description where there shouldn't be. Checking in the CSV, I find that the client has added a few hundred new products whose names include 'Hahnemühle Albrecht Dürer' (the product supplier) and other products whose names &/or descriptions include the micron symbol 'µ'. As you've probably guessed, the characters which are being replaced are ü and µ. FYI, the site is still using MySQL 3.23.58 - I know it's old but we've just persuaded the client into a new .NET and MSSQL site re-design starting in a couple of weeks and we'll be dicthing that server so upgrading isn't an option. I guess that I would be doing a search and replace for these characters in PHP (by ascii code?) and then inserting into the database. Then doing the reverse when displaying the product on the page?
View Replies !
View Related
Inserting New Data
I have a form that has name, address, city, state, zip. All this goes into a single table. I want to add an additional table to put the cities into. I want to pull the cities from the city tables into a dynamic dropdown to choose the cities from.My problem is if I have a city already in the city table, I dont want to add it again and have duplicate citys in the dropdown. Anyone have a clues on how I would do this?
View Replies !
View Related
Inserting Data Into Two Tables
if I want to insert data into two tables how do I do this? Is this right? I'm guessing not as it doesn't work What should I do? $query = "insert into requests (word,status) values ("$req","pending") AND insert into known_by (word,user_name) values ("$req","$user_name")";
View Replies !
View Related
Problem In Inserting Data
I have a table with 8 fields ,,in which one PK and two indices ,, now I want to insert a new data , and to avoid dublication I want to check the two indices together IF they are equal to the similar fields in the coming data , I want to remove the existed or update it completely (changing all the fields) , so I tried using INSERT.....ON DUBLICATE UPDATE .. it will check only the PK or one index then give you the chance to update one field ..(that what I understood about it). another way is , using REPLACE , but also it only checks the PK ... I dont want to check the PK.. it is only (AI) auto increment number HOw to do it saying like this : INSERT INTO mytable (A,B,C,D) VALUES (A1,B1,C1,D1) and IF the stored A == the coming A AND the stored C==the coming C THEN delete the existed or dont insert this row
View Replies !
View Related
Inserting Data Into Table
My task is to create a table which works as a "linker" of two other tables. In this linker table as foreign keys I am using keys from this two tables. I am inserting data into first table t1 in one loop in Perl script, then in a second loop I am inserting data into table t2 and immediately after into t3 which is a linker table between t1 and t2. I have no problems with id (primary key) from t2 , but while extracting keys from t1 there is message: Subquery returns more than 1 row after subquery: insert into t3 (t1id,t2id) values ((select id from t1 where name like 'x'),(select max(t2id) from t2)); simply because value '' are present in table t1 two times so it has two keys. How this problems can be solved? I tried to use: insert into t3 (t1id,t2id) values ((select id from t1 where name like 'x'=ANY(select id from t1 where name like 'x')),(select max(t2id) from t2)); however then there was a message:ERROR 1048 (23000): Column 'id' cannot be null because it is t1 primary key? Are there any ways of dealing with this problem?
View Replies !
View Related
Inserting Dynamic Data?
In the connectorJ example: stmt.executeUpdate( "INSERT INTO autoIncTutorial (dataField) " + "values ('Can I Get the Auto Increment Field?')", Statement.RETURN_GENERATED_KEYS); it works perfectly fine for static text. I can't seem to figure out a way to get it to accept dynamic data (from java beans etc) i.e. mybean.getA(), myBean.getDate for example: "values ('Can I Get the Auto Increment Field?'" + getA() ) gives me a compilation error. What's the proper syntax?
View Replies !
View Related
Trouble With Id + 1 When Inserting Data
I'm trying to find a good alternative for auto_increment, the reason is that I need to know what the next value of id will be before inserting data into the table and I haven't found a relyable way of doing that with auto_increment. My plan was to use a commend like: INSERT INTO temp (id, test) VALUES (MAX(id)+1, 'foo') But I am getting the error: ERROR 1111 (HY000): Invalid use of group function.
View Replies !
View Related
Problem Inserting Data
I'm having an issue inserting data into a MySQL database using PHP code which has worked before. Some of the fields in the form have been removed and so are not passing data across to the insert script and the insert has been altered to show this, apart from that everything is the same. Could anyone help me diagnose what is going on this code to not make it work, I've been looking for the last 2 hours and just cannot find the problem. Data entry page PHP <? if(isset($_GET[submit])){ $error='' if ($_GET['heightcm']=='') { $height=($_GET['heightinches']*2.54); } else { $height=$_GET['heightcm']; } if ($_GET['widthcm']=='') { $width=($_GET['widthinches']*2.54); } else { $width=$_GET['widthcm']; } if ($_GET['depthcm']=='') { $depth=($_GET['depthinches']*2.54); } else { $d
View Replies !
View Related
Inserting Unicode Data In Forms6i
i m using forms 6i with oracle 10g. i have set Nls_lang =American_America.UTF8. Now my problem is when i type some data i marathi Using a font converter engine directly into the text box on form i just get ?in the text box. when i type same data on notepad n then paste it in textbox it gets properly pasted and also get inserted in oracle.I m also able to retrive it back properly.So i think it is not the problem of my character set.Also i have set the font of textbox as Arial Unicode Ms. i m not getting where the problem is?
View Replies !
View Related
Inserting Data Into Multiple Tables
I am just learning both MySQL and PHP, and have a question about a project I am working on. The first (and main) table for this project has the basic information about an refund request, including an autoincrement unique ID. Another table includes the products and uses the ID as a reference. The third table is the history of everything that happens to the request. For example, the information may be as follows. Credit table ID - autoincrement status - requested, needs authorization, processed, etc agent - who entered the request customer - person requesting the refund other customer info order table ID - reference to Credit table Item - item ID for amount requested quantity - number purchased price - price of each item (total information is calculated on above fields) history table ID - reference to credit table seq - id for each history log old status - the previous status new status- the status after the update to the record agent - agent making the change notes - a description of what was done. I have the PHP form that collects the data to be entered. My question is, since the first table is an autoincrement, what is the best way to insert a record into the Credit table, pull the ID that was just entered into the credit table and insert that ID into the order and history tables?
View Replies !
View Related
Inserting Huge Amount Of Data In DB
I've got a script that scan .csv files and have to add data in a DB. I've try to save data into array and only insert data at the end in one shot, but I got memory problem. I would like to know the best way to add about 1 million of data in DB. Do I go with one query per data? Do I try to say cumulate like 100 data and then insert them and repeat this until it is done?
View Replies !
View Related
Inserting IP Into Database
Im making a register script. And ive got a field on it called userIP and here is the code for it <input type="text" name="UserIP" value="<?php echo $_SERVER['REMOTE_ADDR'];?>" size="32" disabled="disabled" /> but when i submit the form is says "Column 'UserIP' cannot be null", when it is clearly not null Code:
View Replies !
View Related
Inserting 100 Rows Of Data Into An Existing Table
I want to import 100 rows of data from an Excel spreadsheet into an existing MySQL table. Both the spreadsheet table, and the MySQL table have the same exact format & headers. In MySQl Query Browser, I can locate only the Edit function, which seems to only allow me to type in the data line by line. Can I import the data in MySQL Query Browser, or do I need another product? And if I can import, how do I do this?
View Replies !
View Related
Inserting Data Into A Table From A Text File
I have a table in MySQL with the columns: "ID, JokeText, JokeCategory, JokeDate". I want to take a text file that is a long list of jokes, and load each joke into a new row of the table in the JokeText field. I have tried a bunch of different approaches, and just can't get it to work right. Can anyone enlighten me? If it helps, here is a sample from the jokes text file (yes, they are stupid :P) Q: What goes up and down but does not move? A: Stairs %% Q: Where should a 500 pound alien go? A: On a diet %% Q: What did one toilet say to the other? A: You look a bit flushed. %% Q: Why did the picture go to jail? A: Because it was framed. %% Q: What did one wall say to the other wall? A: I'll meet you at the corner. %%
View Replies !
View Related
Table Breaks After Inserting Data With MyISAM
One of my tables keeps getting broken after I add a bunch of data to it. I have reinstalled MySql and recreated the DB several times. In mysql 5 it says the table was marked broken and in mysql 4.1 it says "Got error 127 from storage engine". After I use repair table almost all of the data is gone, and only 10 from 1104 added rows remain, but it's always the same rows. It's the 10 rows where the value for volume is 0 (well it's 000 in the query). I am using the MyISAM DB-engine on my tables. I can fix this problem by changing the db engine to InnoDb, but I wonder why it doesn't work properly with MyISAM? the DDL code for the table is like this: CREATE TABLE `quotes` ( `ID` int(10) unsigned NOT NULL auto_increment, `security` mediumint(8) unsigned NOT NULL default '0', `open` float unsigned NOT NULL default '0', `high` float unsigned NOT NULL default '0', `low` float unsigned NOT NULL default '0', `close` float unsigned NOT NULL default '0', `volume` int(10) unsigned NOT NULL default '0', `splitfactor` float unsigned NOT NULL default '1', `date` date NOT NULL default '0000-00-00', PRIMARY KEY (`ID`), UNIQUE KEY `unique_security_date` (`security`,`date`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; I uploaded the insert query I used here: http://users.skynet.be/ecare/insert_quotes.sql
View Replies !
View Related
SQL*plus Inserting New Row With Values = To Existing Rows Data
I am trying to insert a new employee into an empolyee table and get some of the values (namely phone no.) to be the same as what another employee currently has. This new employee is replacing the old employee, but i have to keep the old employee alive in the db as other data is reliant on its existance. I was wondering how do i insert the new employee asking the, VALUE ('etc', 'etc',) line, to assign a value to certain fields equal to the value contained in other employee rows.
View Replies !
View Related
Inserting Data From Text File Question
I have a sql table with about 9 fields of data in it.The first 3 are filled and the last 6 are currently blank. I have a tab delimited .txt file containing data for each of the 9 fields and want to import it in phpmyadmin to both overwrite the existing data in the 3 fields and fill out the other 6. However I only want to import the data where one of the existing filled-out fields "TournamentID" equals 10. But I'm unsure how to do this. Will this work?: SELECT * FROM `tbl_finish_pos` WHERE TournamentID=10 then check every row returned and select the Import tab in phymyadmin to insert the .txt file
View Replies !
View Related
InnoDB Not Inserting In Database
I have a jsp form that does a simple insert into a database with InnoDB tables. I need this because of foreign keys and such. Below the form on the same page is a list which does a select on the same table the insert goes. So you insert one thing, the page refreshes and you see your insert in the list. That happens! BUT there is nothing inserted in the database. So i think the results that I see are stored in the session of the page or something (hash or something, i dunno). When i try the same with a MyIsam database it inserts fine. I've already set global transaction levels to READ-COMMITTED (what I understand from the manual is that this is what i need), I've set that by command line and also in my.ini file (restarted the server too). The select@@global.transaction_level; shows that it is set good. Need I to do something with auto commit also? I really don't understand that chapter, is it supposed to be on, off, set to 1 or what, for what i need?
View Replies !
View Related
Inserting / Updating Database
I am using ASP with MySQL. This is code for a calendar application that saves info to the database based on date. It is not giving an error when processed. Nothing is being inserted into the database and nothing is being updated either. Code:
View Replies !
View Related
Inserting Multi Table Data To Flat File
I have two tables; trying to get the data in to one row for the result set. Example: t1: iddescription 1apples 2oranges t2: idt1_idlabeldate 131added2008-01-23 141modified2008-01-23 132added2008-01-24 142modified2008-01-24 The result I would like to see is as follows: iddescriptiondate_addeddate_modified 1apples2008-01-232008-01-23 2oranges2008-01-242008-01-24 Looking forward to your solutions!
View Replies !
View Related
Inserting Small Image Directly Into Database
How do you insert an image into a table directly using something like data studio? I have tried googling it and it seems all the examples are using a language to do it for you. The images are between 2-4k and the table is just an int column followed by a blob column. I just thought the statement would go like INSERT INTO sometable VALUES (1,'image.jpg'); The web suggests uploading and downloading in PHP (which im using) but im building the data first using data studio then just displaying the table information using PHP. Before i go into displaying the information on the page i just wanted to make sure the insert query is correct.
View Replies !
View Related
Using MS Access To Get Data In / Out Of A MySQL Database
I have no experience using MS Access to interface with MySQL. I have a tiny MySQL database that might need to have Access connect with it over the internet and grab data/update etc. Is this practical and what does it take to do it? My project is not time sensitive but I'd like to see what methods I can use to do remote queries with my database running on a *nix/Linux server.
View Replies !
View Related
Import Old Data To New Mysql Database
My machine was down before, fortunately I have back up the whole /usr/local/mysql directory. Now I have setup a new mysql on a new machine, how can I import the old data back to the new database?? My old mysql version: mysql-3.22.32 new mysql version: mysql-max-4.0.3-beta-sun-solaris2.7.sparc I used to run the mysql like this: /usr/local/mysql/bin/mysql abc should I add the user abc to my new database first? and how?
View Replies !
View Related
Clean Mysql Database Data
we are using mysql server 5.1 and I have a database which will contains about 500 to 1500 tables in that one . I want to clean the database data and restore it in a new database frequently . Previously I used php myadmin (wamp server) to clean the data . I am getting the clean database but the thing is I am not getting relations. Relations are missing in the database.
View Replies !
View Related
|