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 Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
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 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
Inserting Into A Table Static Values And Values From An Existing Table
I am designing a content management system for my work-term and I basically need some help in data insertion. What I have is two tables, each with different field (Column) lengths. I am taking data I store in what is a mysqllate table ( basically mysqllate/default information), and appending it to another table which will be an actual production table that will be used in the website. This table still has 3 more fields so basically this is how it goes: mysqllate table: DOCID int(11) No DTID int(11) No ID int(11) No requirements text latin1_swedish_ci No reqd varchar(100) latin1_swedish_ci Yes NULL date varchar(100) latin1_swedish_ci Yes NULL Production Table: RID int(11) No DID int(11) No DTID int(11) No ID int(11) No req mediumtext latin1_swedish_ci Yes NULL reqd varchar(45) latin1_swedish_ci Yes NULL date varchar(45) latin1_swedish_ci Yes NULL comply varchar(45) latin1_swedish_ci Yes NULL notes mediumtext latin1_swedish_ci Yes NULL Therefore as you can see RID, comply and notes, are to be static values determined before the insertion of the data. I just do not want to have to query 900 rows of mysqllate info through PHP append the static values and then re-insert there has to be an easier way, perhaps through a view..
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
Finding Column Values Present In One Table, But Not In Another Table
have two tables, 'widgets' and 'widget_cats'. The primary key for widgets is 'widget.widget_id' and the key for widget_cats is a two-column key, 'widget_cats.widget_id,widget_cats.cat_id'. A particular widget_id can have more than one category, and so be present multiple times in the widget_cats table. I'm looking to find the widget_id's of ids that are present in the widget_cats table, but ont in the widgets table. For instance say the pair '515,A98' is in the widget_cats table, but '515' is not present in the widgets table. I'd like '515' to be among the values returned.
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
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 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 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 !
View Related
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
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
Inserting Values From 1 Table Into Another Table
I have 2 tables: A and B Table A contains fields u, x and y Table B contains fields u and z Table A has all possible variations of u. Table B has some of the varaiations of u in it. My problem is that I'm trying to insert the z-values from Table B into Table A's y field and link them up based on the u-values. I'm running into problems like truncating at row 0. I've tried the following queries: update TableA set y =(select TableB.z from TableB where TableA.u=TableB.u) update TableA,TableB set TableA.y =(select TableB.z from TableB where TableA.u=TableB.u)
View Replies !
View Related
INSERTing Into A Table, With Values From Another Table
I'm programming a shopping cart application, where the products are categorized into different lines. I have a table that defines the different product lines, and now want to populate the product table. However, the text file with the products in it, which I will use to populate the products table, uses the line NAME for each product, when I wish to use the line ID instead. To get the line ID, I would need to get the value from the line table. My question is: is it possible to populate the products table with data from the products text file, as well as a column from the lines table? That is, the INSERT (or LOAD DATA) statement will insert column values from the text file, but the line id from the lines table instead of the line name found in the file (WHERE line name = line name in the lines table). I'm still not sure whether to use an INSERT, and write PHP code to go through the text file, or to use LOAD DATA for this task, because I don't know which statement would support what I'm looking for.
View Replies !
View Related
Add Values To Table
I have a table tblMailingList. It has 3 columns; Name, EmailAdd, AutoID. I am using mysql> INSERT INTO pet -> VALUES ('name1','u@me.com'); but I am unsure as to what to do for the AutoID field. If I use the example given, the error message says that the number of fields is different. How do I get this info into my table?
View Replies !
View Related
Update A Table With Values In Another
I have the following table tableA column_a column_x column_y column_z tableB column_x column_y column_z How do I update the rows of tableA that match rows of tableB (all rows of tableB are unique) What I want to acheive is a check against tableA.column_x with tableB.column_x, if they match, then update the row in tableA.column_y with the value of tableB.column_y and tableA.column_z with tableB.column_z
View Replies !
View Related
Select Values From The 2 Different Table
Sample tables (company_id RK companies.id): Companies id company 1 … 2 … 3 … Locations id company_id location revision 1 1 … 1 2 2 … 1 3 1 … 2 4 1 … 3 5 2 … 2 6 1 … 4 How to write an SQL query to select values from the following columns (companies.company, locations.location) where locations.revision value will be the highest for each company I try Select distinct companies.company, locations.location from Companies, Locations where companies.id=Locations.company_id order by locations.revision
View Replies !
View Related
Duplicate Values For Another Value In The Same Table
I have a permission table that gives a userID permission to a module and the any actions within that module. What I want to do is duplicate his permissions to another user. Permission table has: id (PK) userID (FK) module action When I do an insert and do a select of the values of the first user, it says It cannot use the target table in the FROM clause.
View Replies !
View Related
DISTINCT Table Values
I use DISTINCT to select distinct values of one column... but i can not use distinct selecting more values of that row. select DISTINCT(field1) from table works select DISTINCT(field1), field2, field3 from table does not work
View Replies !
View Related
Update Table Values
I have a csv.txt file with contacts and their information in it. Then I also have a table in mysql with the same contacts and their various information. I need to merge these to so that if a field value in the database is NULL the value that is in the csv.txt file is inserted into the database field. I have been looking at the mySQL site on how to do this but have not been able to produce a working solution. Below is a more detailed example of what I am looking for. Code:
View Replies !
View Related
INSERT Values From One Table To Another
In table A i have a.id and name and in table B, i have b.id, a.id(FK) and owns. Table A -------------- a.id | name | -------------- 12 | James | 13 | Paul | 14 | Tom | 15 | Andy | Table B -------------- b.id | a.id | owns | -------------------- 1 | 12 | Car | 2 | 12 | Bike | 3 | 13 | PC | Now what i want is to add two new names to table A which will be Tom and Andy and have the same data in table B for Tom and Andy with just different b.id (PK). How can i insert this new data in table B using insert?
View Replies !
View Related
Update Values In Another Table
Table one has columns thread_forum_id and thread_thread (and a bunch of other stuff) Table two has columns topic_id and post I would like to populate thread_thread with the data from post however the columns thread_forum_id and topic_id need to correspond to each other when i do this. for instance if topic_id = 1 and post = A and another row is 2 and B then i want the resulting table one to have 1 and A 2 and B but not 1 and B or the other way around.
View Replies !
View Related
Returning Values That Are In One Table, But Not In Another
I'm looking for a query to return values which occur in one table, but not in the other. Say we have two tables (table_1, table_2) each with a column titled "appointments". I want a list of results for appointments which are in table_1, but not in table_2 I have tried the following, but all I get is a huge list of duplicate appointments which occur in both tables: SELECT table_1.appointments FROM table_1, table_2 WHERE table_1.appointments<>table_2.appointments; I've also tried 'NOT IN' for this but the result was just the same.
View Replies !
View Related
Most Common Values In Table
I've been looking around the MySQL and PHP documentation to no avail, Basically, say we have a table of names: id, name 1, Danny 2, Sam 3, Kerry 4, Danny 5, Paul 6, Sam 7, Kerry 8, Danny 9, Jack 10, Hudson ...and we want to determine the most popular, second most popular, etc. In this example, the most popular name is Danny (3 rows), the second most is tied between Sam and Kerry (2 rows each), then Jack, Hudson and Paul only have 1 row each. In the case of a tie, I would simply sort the two rows alphabetically. The resulting popularity ranking would be: 1) Danny (3 results) 2) Kerry (2 results) 3) Sam (2 results) 4) Hudson (1 result) 5) Jack (1 result) 6) Paul (1 result) Is there any way I can do this with MySQL?
View Replies !
View Related
Generating A Table With Missing Values In SQL
I have the following table: +------+------+------+-----------+ |ID |GROUP |CODE |ANSWER | +------+------+------+-----------+ |1 |1 |001 |01-01-2003 | |2 |1 |002 |Yes | |3 |1 |003 |NA | |4 |1 |004 |297797 | |5 |1 |005 |0 | |6 |2 |002 |Yes | |7 |2 |004 |297852 | |8 |2 |005 |1 | +------+------+------+-----------+ This means that code 001 and 003 of group 2 are missing. Result of the query should be: +-------+-----------+-----------+-----------+-----------+--------+ |GROUP |ANSWER1 |ANSWER2 |ANSWER3 |ANSWER4 |ANSWER5 | +-------+-----------+-----------+-----------+-----------+--------+ |1 |01-01-2003 |Yes |NA |297797 |0 | |2 |NULL |Yes |NULL |297852 |1 | +-------+-----------+-----------+-----------+-----------+--------+ The missing values should be replaced by a NULL value in my resultset. Is this possible? I don't have any clue how my query should look like, can anyone help me and show me a solution?
View Replies !
View Related
Renaming Values In Table With ENUM
It seems that this table was created with some ENUM data types so I'm trying to figure out how this works. I can post the script that created this table but basically I'm trying to rename a value in this column document_type ENUM('FAQ', 'Sheet', 'Marketing Resource', 'Teacher Guide', 'Reference / User Guide') NOT NULL, I'm not sure how this array is stored and what would happen if I tried to rename the value ....
View Replies !
View Related
Renumber Mysql Table Values
There are 100000 rows in a table, I need to renumber them from 1,3,6,8,11,14,21,55,888,1000,9999...99999 to 1,2,3,4,5,6,7,8,9,10,11,12,13,14... etc I also need to update an associated table, so its going to need to lock the tables, find the lowest available index in table1, then update table1 index, and then update table2 to use the same index as well, then unlock tables What would be the procedure to do that?
View Replies !
View Related
Update Query Where Values Will Come From Other Table
I'm creating an update query which the value will come from another table. I have here my current query which unfortunately makes the system hangs. Probably because of the query itself is not properly coded. update boxes b inner join messages m on b.ctnnumber = m.ctnno set b.consigneerecv = m.CName, b.consigneerecvdate = m.DateRcv, b.phrecventered = "Y", b.PhilStatus = "delivered", b.prevreleasestatus = b.releasestatus, b.releasestatus = "delivered", b.PhilStatusDate = m.smsrecvdate, b.phdelprice = "0.00", b.phdelamt = "0.00", b.recvrelation = m.Relation, b.APRecventered = m.smsRecvDate where b.consigneerecv = '' or b.consigneerecv = 'NA' or b.consigneerecv is null; I'm thinking revising it so that it will not cause the system to hang but I don't know how. Guys please help me with this one. I also have this another idea which probably will not work. My idea was something like this: Update table1 set table1.column1 = (select table2.column1 where table2.column1 = table1.column1), table1.column2 = (select table2.column2 where table2.column1 = table1.column1), .....
View Replies !
View Related
An Enum Field Using Values From Another Table
The first table, called genus, contains several fields, the important one in genus is name, and there are others about the individual plant types. The second table 'plants' needs one field for the genus name, so that I can link tables on this. If there a way to make a foreign key from the genus table into an enum field on the second? My idea is that then, with phpmyadmin or similar I can just select the genus name from a list when entering new plant data.
View Replies !
View Related
Updating A Table To Increment Values
Question, if I want to update all values in a certain column to increment by one, what statement could I use? In quasi-MySQL, this is my pseudocode: UPDATE table SET fields=[previous_val+1] where [previous_val]>[my_val] Or do I HAVE to run a SELECT query, increment the value, and THEN Update it? I was just thinking there'd be an easier way.
View Replies !
View Related
How To Autoupdate One Field From Another, Using Table Values?
I am trying to update a box with data from a table through typing an input-code in another box. More to the point, I am trying to be able to get "state" data into a box next to the zip-code box, using the zip-code as input. It is supposed to not need the input of state, but update it from a two-column table where column 1 contains zip-code, and column 2 contains the respective states. Mind you, these are not really "states", but more like counties, Norwegian counties... Is there a way to do this, preferably using php? The table is located in my mysql database. Really hope for a good answer to this issue, as I am beginning to lose my hair over this - quite possibly rather simple - question..
View Replies !
View Related
Prevent Values That Do Not Exist In Another Table
products manufacturer category Example: CREATE TABLE categories (category_ID int(6) AUTO_INCREMENT NOT NULL PRIMARY KEY, category_Name varchar(25)); CREATE TABLE products (product_ID int(6) AUTO_INCREMENT NOT NULL PRIMARY KEY, product_Name varchar(30), quantity varchar(10), price float(5,2), category int(6), manufacturer int(6)); CREATE TABLE manufacturer (manufacturer_ID int(6) AUTO_INCREMENT NOT NULL PRIMARY KEY, manufacturer_Name varchar(30)); mysql> select * from products; select * from categories; select * from manufacturer; .....
View Replies !
View Related
|