Editing Part Of Field In MySQL
I exported an excel database with no number formatting to a comma delimited txt file and imported it into mySQL. The database contains 24000 rekords.
For some reason some 3000 odd rekords were imported with .00 decimals. Is there a way through a SQL query that I can delete ONLY the incorrect .00 data from multiple fields? I don't exactly look forward to manually editing 3000 rekords!
View Complete Forum Thread with Replies
Related Forum Messages:
Create A Field By Deleting A Part Of The String From Another Field!
I have a table for "Addresses", which has a column titled "Address" and the records in this column are a combination of house#, street name and street suffix, which typically looks like "100 Main Street". I am looking for a query result wherein a new column would be created which would have only the street name and the suffix and would eliminate the house #s, hence the result would look like "Main Street".
View Replies !
Editing Content Contained In A Field
I have a table in my database where I need to search for text withing a field and delete it. The text that I need to find is not the only text in the field, it is in the field with other text. I am able to single out the records that need updating by using the statement: SELECT * FROM `events` WHERE `EVT_name` LIKE '%Jazz Stage: %'; How do I edit the fields using a simple query?
View Replies !
Deleting Part Of A Field
i have a table called, videos, and a in that table i have description fields, that all contain a description followed by {video}randomnumbers{/video} and i want to delete the {video} + {/video} and the random numbers between but leave the other parts of the fields,
View Replies !
Sort By Numeric Part Of A Field
I must sort a table width only one column. Inside the field I have, for example, hard disk capacity (something like '100Gb' or '80Gb' or '80Gbyte' or 'Gb80'). So, if I use ORDER BY ... DESC, 80Gb will be before 100Gb and other errors. How can i sort the table only on the numeric part of the field? I'm trying using CAST() but with no results.
View Replies !
Select Part Of Text Field
I want to get a snippet from a text field. I don't want the whole thing, just the first 200 characters, for example. Is this okay or is there a better way? SELECT title, LEFT(body, 200) as body FROM table.
View Replies !
Update Query For Part Of A Field
I need to update part of a field in around 3000 rows of a table. In each case the field in question has text already in it but I need to add an extra bit of text to the start of each one. I've had a look on the web and have found examples that show you how to replace text in part of a field but haven't found anything about adding new text.
View Replies !
How Do I Update Part Of A String Value In A Field
I have information in a field as follows: |___col___| | AAXXAAA | I need up update all instances of the substring 'XX' in the 'col' field to 'YY', but I do not know how to structure the SET portion of my update statement to do this. Below is my update statement minus the set portion. UPDATE db.table SET col = <need help> WHERE col LIKE '%XX%';
View Replies !
Noob: Sql To Select Part Of A Text Field
I have a text field in mysql database. record1: id:1 text_field: apple, oranges, grapes record2: id:2 text_field: grapes record3: id:3 text_field: oranges I need a sql to select records 1,2,3 for word "apple or oranges or grapes" in text_field.
View Replies !
Part Of A Field Into Another Field
I have a table with an email field that contains values of the form uid@domain. I need to populate a new field called uid with just the uid part of the email address. Is there any way of using select to just retrieve the part before the @ and insert it into the uid field?
View Replies !
Editing A Mysql Database
1) I have FTP access to the server. How do I go about setting up the initial database? Do I do it or do I request to have it done? If I do it, can someone point me to a resource. If the server admin does it, what do I ask him/her for? 2) Ok, so now I have a mySQL database. Is it "portable"? What I mean by that is that with Access, I could browse on my hard drive, or server for that matter, and I would see a file called somedb.mdb. Is this the same with mySQL? Also, with an Access file, I can open it in MS Access and add,edit, and delete data all day long. How is this done with mySQL?
View Replies !
Editing Mysql.proc Table
I need to use comment column in mysql.proc table but 64 characters is not sufficient for me. If I edit it to something like 100, is there any impact to mysql server?
View Replies !
Editing Row Data In A Table Using Mysql
I'm trying to edit the data in a table using mysql. As far as I know I can view the data in the particular row of the table using the comand: "select row.name from table.name; And mysql has the "edit" command. Is it possible that I can use the "edit" command to edit the data in the table? What command should I use? If not what is the simpliest, command line method can I use to edit the data in the table? "mysql --version" returns: mysql Ver 12.22 Distrib 4.0.21, for pc-linux (i686)
View Replies !
Html Form For Editing Mysql Database
What I need is large text area boxes to appear on the page. The data I'm editing includes carriage returns and quotes here and there in the text. Besides the text appearing in a small box, the text ends at the first instance of a carriage a return. Code:
View Replies !
MySQL Uses Only Part Of The Key When I Add An OR
I'm trying to understand why MySQL isn't using all parts of the primary key when I add in an OR statement in the query. I have a people database, and a distances database. The people database lists a person's name and their location, the distances database contains the distance between any two points in the country. There are an roughly 15000^2 entries in the distances table, and currently about 100 entries in the people table. The schemas are as follows: Code:
View Replies !
Use MySQL As Part Of A Web Page
I would be interested in hearing opinions on how easy or difficult it it to use MySQL as part of a Web page. I have no experience with MySQL, but I have experience with MS Access and VB. The project that I'd like to put together is an online ordering facility for videotapes, not too many concurrent users and relatively low volume as these things go. I am also interested in how one would go about integrating the MySQL database with a site constructed with MS FrontPage (2000 or 2002).
View Replies !
MySQL As Part Of RedHat 9 Install
When I did my RedHat9 install, I choose Workstation and customized the packages I wanted install. As a part of that customization, I chose mySQL DB; however, I can't seem to find any RedHat documentation that says how to get to these installed packages. I would like to just start using them, but not sure where to start. Any hints to get up and going quickly?
View Replies !
Command Editing
I'm running mysql 4.1 on a Mandrake 10.1 machine. When I try to edit commands using the arrow keys, many keys don't work properly, most notably the delete key. That is, if I make a typo at eh beginning of a long command, I have to way to correct it. Entering the delete key just echos tilde characters in the console. The bash prompt itself recognizes all these keys correctly. This sort of command editing seem to work fine under Win2K at the command prompt.
View Replies !
Editing A User
I'm following a tutorial but my code seems to get stuck somewhere and not give any errors. <?php $page_title = 'Edit a User'; include('header.html'); echo '<h1>Edit a User</h1>'; if((isset($_GET['id'])) && (is_numeric($_GET['id']))) { $id=$_GET['id']; } elseif((isset($_POST['id'])) && (is_numeric($_POST['id']))) { $id=$_POST['id']; } else { echo '<h1>Error!</h1>'; include('footer.html'); exit(); } require_once('mysqli_connect.php'); if(isset($_POST['submitted'])) { $errors = array(); if(empty($_POST['first_name'])) { $errors[] = 'Enter a first name'; } else { $fn = mysqli_real_escape_string($dbc,trim($_POST['first_name'])); } if(empty($_POST['last_name'])) { $errors[] = 'Enter a last name';.....
View Replies !
Editing Text
When I find out too late that I have missed off a vital comma how do I get back to edit the text?Sorry if this is rather dense of me - but all I seem to be able to achieve is getting to the beginning or end of the line I am on!
View Replies !
Editing MY.CNFfile!
Does anyone know how one can edit the my.cnf file using the SSH console. I ran the following shell commands which shows the details of this configuration file. But how then do i edit it? cd /etc vi my.cnf I also dont see any InnoDB setting when i view the config file. See screenshot for more clarification The reason am trying to edit the file in the SSH console is because that is the only way of i can view the file. It is not visible using an FTP program hence this route. I need help need to change some InnoDB settings.
View Replies !
Editing Not Working In PhpBB
After transfering my forum from one server to another, editing stopped working. You can go to phpBB's edit link, but when you try to edit the post nothing is changed. Topic titles can be edited, but nothing else can (including uploaded files with the attachment MOD). If I edit it directly from phpMyAdmin it will work fine, but editing through the forum does nothing. On the last server it worked fine, although I'm pretty sure on my last server I was running on an older version of MySQL (3.x). On my new host (globat) I'm on MySQL 4.1.Nothing was changed in phpBB's scripts since the transfer, so nothing would have taken away the ability to edit post text. If anybody knows what is stopping these things I would greatly appreciate the help, since I've been looking for a solution for quite some time now.
View Replies !
Editing Read Only Tables
ive got a database in phpmyadmin..i need to change a value in a coumn in a table..but when i do so, the following error message would show up: Quote: MySQL said: Documentation #1036 - Table 'table' is read only how can i deal with it
View Replies !
Stored Procedure Editing
If I am creating a stored procedure from the mysql command prompt, it seems that I have to type all the content. Is there a way to paste text or load it from a text file into a stored procedure? I anticipate that the commands and querys will be lengthy and complex.
View Replies !
Editing Values In A Table
I just moved from SQL Server to MySQL and in the Enterprise Manager in SQL Server I could query the entire table and then modify the values with the table without writing an UPDATE statement. I cannot do that in one of my tables because the EDIT at the bottom is greyed out. There are other tables where I can make a modification to any value I want within the table.
View Replies !
Command Line Editing
Using the command below as an example. I would like to know how to properly edit a command after a missed "'" {see [missing"'"]John', 'Smith',... Before I noticed the missed "'" & even though I up arrow & make the change it is done with a cursor line that starts with '> instead of -> (the normal mysql command line) -> INSERT INTO users3 (first_name, last_name, email) VALUES -> (John', 'Smith', 'jsmith@abc.com') '> ****** Here is where i would like to get back to the normal command line ****
View Replies !
Editing Values In PhpMyAdmin
i'm trying to modify my dbase via phpmyadmin and, obviously, am new to mySQL and such (hence the newbie forum) wondering... a command like this: ##CREATE TABLE phpbb2_forums_watch ( ## forum_id smallint(5) unsigned NOT NULL default '0', ## user_id mediumint(8) NOT NULL default '0', ## notify_status tinyint(1) NOT NULL default '0', ## KEY forum_id (forum_id), ## KEY user_id (user_id), ## KEY notify_status (notify_status) ## ) I've been able to add the table easily enough w/ the three values -- but what does KEY forum_id(forum_id), do? How can i do this in phpMyAdmin?
View Replies !
Editing And Amendment Of DB Or Its Tables.
If I set up the DB or any of its tables ot their fields wrongly, is it a straightforwadr matter of changing various values via phpMyAdmin or by coding directly, without losing any data or other tables settings? I hope so, so that I can make a bit more progress. Y'see, i think I have my hand written tables normalised but I haven't yet spent much time learning how to setup each table and the fields in each.
View Replies !
Editing A Record Simultaneously
I did a search but couldn't find anything regarding the following. I'm working on a small application with table records (in this case containing a field for a chunk of text, and other fields for a title, created/modified date etc.) that can be edited by more than one person, but NOT at the same time. So what I plan on doing is having a yes/no field in that record indicating if that record is currently being edited, with this field being changed during a transaction. If a record is not being currently edited then whoever gets to the record first will become its editor, and then the editor is the one who can release the record back into being allowed to be edited again. My question is if the current editor of a record hangs onto it for too long, how can I automatically "release it back" to being editable? For example the editor's computer may crash, or they may go away from their computer for a while etc. I am thinking that when the record is first obtained it is stamped with the current time along with the "not editable" flag being set. Then in the future if someone else comes along to edit the record, if the record is still not editable, but the timestamp is now (say) 30 minutes in the past, then the record can be edited. Would that work? Can anbody see any other problems I might come up with? Also, does anybody know of any online articles that discuss the things to consider when "simultaneously" editing records?
View Replies !
Passing Or Acquiring Data For Editing/updating
i'm trying to adapt someone else's scripts to acquire information, and edit/update this information. i can display the info through an array, example: foreach ($url_array as $row) echo $row['bm_URL']; how do i edit this data, and update that same row? i understand that i need to go to a new file, say edit_url.php. in displaying the data, do i need to request the data anew? for example: if (!($conn = db_connect())) return false; $result = mysql_query( "select * from bk_bookmark where username = '$username'"); if (!$result) return false; //here is the start of where i am having difficulty retrieving info $url_array = array(); while ($row = @mysql_fetch_array($result)) { $row->bm_URL=addslashes($row->bm_URL); $url_array[] = $row; } return $url_array; } foreach ($url_array as $row) { # html form/table data <tr><td>edit url</td><td><input value=<?php echo $row['bm_URL']; ?></td></tr> }
View Replies !
PhpMyAdmin Editing Multiple Records Not Working
I'm trying to modify more than one record at a time. I'm checkmarking all the records I want to edit, but when I click on the edit button next to where it asks what to do "With Selected:" it only gives me one record to edit at a time. Any way to fix this pain in the @$$?
View Replies !
Building Dynamic Pages For Editing Database Records
I need to develop a way for my client to edit information in a MySQL database. Basically, something very similar to how PHP MyAdmin works only slighly less complicated. There does not need to be the ability to edit the structure of the database or tables or anything like that, simply the information and entries. I have searched google and yahoo with the following phrases, but have found that most of the results are topics on how to use database editors or where to buy third party software. ------ database administration pages Building MySQL Admin pages building web admin page build a web based database administration console build PHP my admin pages from scratch My SQL Admin pages create web based database administration Creating administration pages Creating web admin page from Access in php ------ I've also searched CodingForums.com for threads from others that may have been trying to do the same thing. I didn't really find anything relevent. Perhaps someone could lead me in the right direction or tell me if I'm not searching correctly. What I'm trying to do has to have been done before, I'm just not having any luck on finding the right information. I figure that I'm going to end up building this from scratch with PHP, but I thought I'd ask to see where to start or if there are examples out there that I may be able to model after.
View Replies !
Extract Specified Part
In one of my table, I have a date type field in format 0000-00-00, in my php syntax, how can I extract the year part only? i.e. only 2005 from 2005-07-08. I searched the help from mysql reference, but too tired for me now
View Replies !
Restoring Part
I've got a backup of all the databases on my server, which includes databases from a number of different users. How do I restore the backup for only one specific user (ie only restore his databases from the backup file)
View Replies !
Showing A Brief Part
I am wondering is there a way to show a brief part of an article? If so how? Maybe up to about 50 words. Should this be posted in the php forum? If so can someone please move it?
View Replies !
Uniqueness On Particular Part
how can i specify that a particular part of a string say from position 3 to 8 must be unique in the table Code: create table temp (a VARCHAR(25) primary key, b varchar(25), unique(b)); now thing is that i dont want all the column value to be unique for column b, just a part of this value must be unique
View Replies !
Replicating Part Of Database
I'm in need of creating reporting database. What I have to do it is to replicate only half of tables to next database so reports could query only that second database. Unfortunately there is too many inserts in existing database so simple master/slave solution won't give me much. I was wondering if there is a way to replicate just few tables? Can I use for it mysql replication or do I have to create manually scripts to do that? I expect that reporting servers is a typical way to report off of transactual systems
View Replies !
Importing Part Of A Database
I have a MySQL database and I want to cut and paste a part of it into my current MySQL database. Is there a certain place that it has to be cut ? Here is a sample of the data, can someone tell me where I start the cut. # # Dumping data for table `category` # INSERT INTO `category` (`id`, `name`, `pid`, `fset`, `weight`, `image`, `descr`) VALUES (8, 'Boat Parts & Accessories', 237, 'miscellaneous', 0, '', ''), (3, 'Exercise Equipment', 21, 'miscellaneous', 0, '', ''), (4, 'Autos', 0, 'auto', 0, ', 'Cars,Trucks,Vans,Parts & Accessories'), (5, 'Motorcycles', 0, 'motorcycle', 0, , 'Motorcycles, Scooters,
View Replies !
Reading Part Of An Entry
I'm on a crash course learning PHP and MySQL and I'm doing pretty well for the amount of time I've had to learn them; however I'm a little stuck on a small thing. I have a database field which is set to take 8 alphanumeric characters, however I want to do a SELECT procedure that takes just the first 4 alphanumeric characters. Is there an easy way to do this?
View Replies !
Replace Part Of String
I want to replace all /thiswebsite/ to /otherwebsite/ in a field called "url" of a mysql databasetable that for example contain: /thiswebsite/link_to_page1/subpage1 /thiswebsite/link_to_page2/subpage1 /thiswebsite/link_to_page1/subpage2 So with a query i need to replace /thiswebsite/ in all records where the "url" field starts with /thiswebsite/ to /otherwebsite/... The REPLACE function in MySQL does not seem to be suitable since it is made to replace the whole value, and not part of it? I need to do this because I'm working with a friendly url cms. Offcourse people will like to have the possibility to change url's, and therefor i need to change all links to it.
View Replies !
How To Do A Substr As Part Of A Query
I want to select from a table all records where the name field starts with a particular letter such as "a" or "b" and so on... but i cant seem to get the where statement to co-operate with me. this is being done in php (if that matters) and on a linux server. the current part of the query that i am trying (or should i say the last one i tried) is" AND substr(b_name,0,1) = '" . $alpha . "' AND ";
View Replies !
Searching On Part Of Feild
I have database called products with each product having a unique code and some details about the product: |----code-----| product name | product details | | 110 10 111 | 50W heater-- | bla bla bla---- | each part of the code tells some more about the product ie: 110 product group 25 product supplier 254 is the actual part number, but this is repeated at times... I would like to be able to query the database and return only products from a specified supplier of only products in a specified group.
View Replies !
Search By 'part Of' Name When First And Last Combined
I have a database that has the first and last name combined under a single column, I'm trying to search, via a php form, the table for matches. Example: Search term entered 'Charlie' Table contacts contains a column named 'name' which holds both the first and last name. (Charlie Brown for example) Is there a SQL syntax that will allow me to do this? The php form contains a field named criteria. Here is the SQL code I'm using. $sql = "SELECT * FROM contacts WHERE name = '".$_REQUEST['criteria']."'"; If the user enters Charlie Brown it will return a result, if the user enters Charlie it returns no results. Changing the database structure isn't an option so if I have to I'll load the ID and name columns into memory and use php to sort, but I'm trying to save cpu time.
View Replies !
UPDATE With SELECT In WHERE Part
I want to execute this command in mysql: UPDATE alerts SET scenario='1' WHERE alerts.cid IN(select alerts.cid from alerts JOIN data ON alerts.cid=data.cid); but I get this error message, though the syntax seems alright to me; ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right.
View Replies !
Multi Part SQL Strings
1. How can i browse my data base table to see if "category" contains a specific word and then return the results. ex: if a "category" is a table key and contains text, and i want to know if the text contains for instance the word "computers" 2. How can i get sql to return random keys from the category table, for instance i'd like to return 40 random entries in category
View Replies !
Emptying Part Of A Record.
I have a table with over 100 records in it, in which i need to empty out two of the fields for each record. I know how to simply drop and empty the entire table, but how can I empty specific fields for all records?
View Replies !
|