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 Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
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 Replies !
View Related
Field Content
I have a table that has field with numbers in it the length of numbers vary i would like to clean it up and only leave the last 6 numbers of that field .
View Replies !
View Related
Selecting Only Parts Of The Content Of A Field?
Is it possible to select only parts of of the content of a field with MySQL? For example if I have some text fields in a table that contain HTML markup in them and I want to only select what is contained within the first <h1> tag from each field. Note that I don't want to just select the fields that have <h1> in them, but select only the text within that tag and not anything else contained in that field. Is this possible?
View Replies !
View Related
How To Save The Content Of A BLOB Field To A File Using Windows Shell
I don't know if someone can help me with this since I am not sure if the problem is more on MySQL side or more on Windows shell's side (cmd.exe on Windows XP). The DB server is on my own computer. For migration purposes I need to store the content of each row of one of my tables into a separate file on my disk. There are various types of content (jpg images, Word and PDF documents, and so on) in this same table. When performing a SELECT BINARY mycontentfieldname FROM mytable in MySQL Query Browser I get the binary content and it even displays the image all right when the field contains an image data. So I know the data can be retrieved. But I need to automatize that with a little script running from the OS shell. So I have tried variations of the following command under the Windows CLI: C:> mysql -uuser -ppassword -Ddatabase --skip_column_names -e"SELECT BINARY mycontentfieldname FROM mycontenttable WHERE id = '7861'" > "C:data7861" In this example I am trying to extract the file of id 7861, which is an image. The script will take in charge all the files, giving its id to each file's name. The problem I encounter is that when I open the "C:data7861" file now stored on my disk with a hex editor, I realize that the data is not copied exactly bit per bit. Some bytes have been replaced, and in particular the '00' pattern (I check that with the field viewer in MySQL Query Browser) is being replaced with '5c 30', causing my file to be unopenable. Here maybe MySQL thinks some special characters have to be replaced before being given to the output. I have tried using the -r (or --raw) option in the command line, but the result is a truncated file. Actually in this example I get a 10 bytes file when the original file is 100 kbytes. I fear that Windows then interprets the '00' as an EOF. My question is: is there a way to get my file using the shell? More precisely, is there a way to deal with Windows and MySQL to get an exact bit per bit copy of the output (maybe using another operator than >)?
View Replies !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
Re-use Content Of An AS Statement
Is it possible to re-use the content of a column that is just created in the SELECT statement? Here an example SELECT (complicated formula) AS result, name, surname, IF(result>16,'OK','NO') AS verdict FROM my_table This doesn't work, because mySQL does not find the "result" column. I know it would be possible to put directly the "complicated formula" inside the IF statement, but since I intend to have multiple such statements, it would be nice not having to copy-paste it X times. I tried to use it by using variables, but it doesn't work because variables can not be set and read in the same statement.
View Replies !
View Related
Duplicating Content Over
I'm intending to have a weird MySQL setup:I've got one server on a stable connection at location 1, running Linux, MySQL and apache I've also got one server on a stable connection at location 2, also running Linux, MySQL and apache The way they are currently setup, when one server goes down hosts are redirected to the other server. Also, load balancing means that if one server is at capacity, another will take control. Both servers are connected via VPN.
View Replies !
View Related
Updating Content
Is it supposed to make only sense if you update the content of your database NOT via a standard rdbms ?and second...do i have to worry about what i ask mysql cause it is so slow?like...i have a query of 17 lines...does it matter at all? and better ask 2 small queries or 1 large?
View Replies !
View Related
XML Localized Content
having stored localized content in the column in format of xml document like following: <?xml version="1.0" encoding="utf-8" ?> <root> <value language="en-CA">test</value> <value language="zh-CN">测试</value> <value language="bg">теÑÑ‚</value> <value language="et">testima</value> <value language="ja">試験</value> </root> so that we could use the built-in ExtractValue function: SET @xml = ' <root> <value language="en-CA">test</value> <value language="zh-CN">测试</value> <value language="bg">测试</value> <value language="et">testima</value> <value language="ja">試験</value> </root>'; SELECT @xml; SELECT ExtractValue(@xml, '//root/value[@language="ja"]') as Label1; is it advisable? What collation the database should be set to? Issues that you see i may run into?
View Replies !
View Related
UPDATE With ' In Content
I'm having some troubles with content being updated in my DB. If the textarea has an ' in it, it throws an error. Here's the code : $query = "UPDATE auliner SET linerFullDescription = '$linerFullDescription' WHERE linerId = '$linerId'"; I've also tried linerDescription = "'linerFullDescription'" Which it doens't like either.
View Replies !
View Related
How To Delete Content Of Column?
I want to delete the content of a single column on a MySQL 3.23 database. Tried DELETE column_name FROM table_name; and other varieties with e.g. WHERE clause. No luck until now. The above statement gives the error msg: ERROR 1066: Not unique table/alias: column_name How to get rid of the content of a certain column?
View Replies !
View Related
Adding Content On Database
i am working on a movie site and i want to add content via MySQL. Im placing content on MySql so i can install a search engine and perhaps other stuff can be installed.but to the point ^^ For example the next content area <image of movie ...> Director: ... Crew: ... Rating: ... ill make templates so all pages are the same. but how can i add the content and images (!) on the .. on a database? and how do i link it in my html pages
View Replies !
View Related
Databasing Chinese Content
My company is looking into developing spanish and chinese versions of their website. Building a custom content management system seems to be the best route for this but I'm curious as to MySQL's ability to database chinese (and other non alphabetic languages like arabic and japanese) content.Has anyone dealt with this issue or have a recommendation on another database platform I could use that offers support for this requirement?
View Replies !
View Related
Saving Content On Database
i need to know this because i am making a movie website. I could make every movie on a single html page but then i would create thousands of them which isnt really handy. So i am looking for a way to save content into my database + a image for every movie. Is this possible? adding content and images on databases and then show them in html pages (with php linking)? if so, could someone plz explain how i can do this and what the php linking code is? In the html files i need a code like: get/fetch #31 and 31 is for example The Aviator. It imports the image and content and its done. Now i dont need to edit the html file, except adding that code.
View Replies !
View Related
Using Different Databases To Separate Content
i'm adding a comment system to my site (among other things) and i was thinking of having 1 database for all the site's content and another for the user comments/etc. i'd have two different users: one with select priviledges only to connect to the first database and another username with select/insert/update for the second. is this a good practice or not at all useful? (would there be any noticeable performance problems by calling to different databases on the same script?
View Replies !
View Related
Change The Content Of The Record?
What function can be used to modify the content in a field? For example, I want to change all the "," into "-" for every record in the field. from | 2007-03-23 | John | classa, classb, classc to | 2007-03-23 | John | classa - classb - classc
View Replies !
View Related
Foreign Language Content With PHP?
How well does MySQL and PHP handle foreign language content? I'm still pretty new with the whole programming and development thing and I have only really developed websites for english audience and clients. If you guys have any good links and reference on how to handling foreign language content, your help will be an asset. Languages: Japanese and Korean
View Replies !
View Related
How To Handle Multilingual Content ?
I have a small cms and now there is the need to store foreign content (japanese/farsi) in the database. I use standard Tiger X-Serve with PHP5 and the preinstalled MySql. And now I need a little help with the foreign language support. The things I did already: 1. I put »charset=utf-8« in the HTML meta tag. 2. I use phpMyAdmin and set the database language collation to »utf8_general_ci« 3. I copy/paste a japanese text from apple.co.jp into my formular and tried to store it into my database. But it seems that is not enough Does anyone know how to solve my problem?
View Replies !
View Related
Error In Database Content
I have a very simple database table that consists of 12 records and 5 fields. I prepared a .txt file to load into the table. For most records, it worked well; the import was what I expected. However, for a couple records, the contents of the last field of the record ended with a @ (I think it was @, I've since gotten rid of it). This extra character did seem to affect queries in that search results I would expect to appear did not. I went to the original .txt file to make sure I did not insert a character that did not belong. No extra TABs or spaces or semi-colons or whatever -- just a line break. And all I found was a line break. For goofs, I deleted the table from MySQL, and tried again, and got the same @ in the same place. What could be causing this? In a small table like this, I can easily manage this. But in a larger table, I'm concerned that the usefulness of queries based on this field are compromised.
View Replies !
View Related
Edit Content Of A Table
In mysqlcc it was pretty straight forward how to edit the actual data that was being held in a table. Now i'm struggling just to figure out where to read the actual data that is being held. If i have a table that has had data written to it, I want to be able to go in and change that data how can i do that?
View Replies !
View Related
|