![]() |
Editing an mySQL database without a primary key?
How can I easily change the one of values in a table wihout a primary key?
*nix running MySQL 3.23.58 |
you need to be very verbose in your update such that you have enough where clauses to make a discreet data set. Make sense?
|
For one row or all rows?
If for all rows, are the values you want to change currently all the same or are they all something different? |
Quote:
dir listings have pretty colors. Quote:
|
why would the primary key matter?
UPDATE TABLE SET column='value' WHERE column='value' |
Quote:
|
It's real easy to do in PHPMYSQL.
|
Quote:
JC if you're not coding something and you just want to fiddle with a table, try downloading PHPMyAdmin. It's free and it's really easy to use. Google for it. It will lay out the database like a spreadsheet so it's easy to look at, and you can directly edit the values for whichever row you want (just click the 'edit' link at the end of that particular row). |
Quote:
UPDATE table SET this_col='' WHERE col_one='' AND col_two=''; ps: http://www.phpmyadmin.net/ |
I've alread ytryed phpmyadmin. It just gives an SQL error whe nI try to edit the contents. Im trying to "hack" (basically append) somthing to a scripts copyrite message. I guess its somehow protected after the databse is initally created.
|
Quote:
|
get out of SQL, in unix type in: rm -r
& and that should do the trick :2 cents: |
Nah, it's not protected. You're probably just using the wrong box to do what you're trying to do or you've got magic quotes turned on or something so that PHPMyAdmin has a problem interpreting things.
Don't use the big SQL box where you can type commands. Instead, Browse the table, go to the row you want to change, and hit the 'Edit' link. When you 'append' your information, don't use apostrophes or quote marks. Alternatively, just look in the code itself and where it calls the value for the copyright message, add your HTML afterwards. (Once the PHP code is done and it goes back into normal html.) Dang this is hard to explain to a non-coder. :) |
Quote:
?? Whats it doing? |
the problem you probably have is that if 2 rows have the same value it would give you an error since it needs a unique identifier to update/delete. had run in that problem myself couple of times using MS SQL when i am editing the data using the GUI.. i don't know if it's the same with MySql but when I just lauch the query from a script it goes trough. a good way to find a solution is to google the error you get or post it here it might help.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
no cli? jesus typed man, no clicky of the mouse for him. you fuckimg imposter! |
I get this error.... right when I click edit.... (THis is BEFORE I have the chance to modify anything)
"There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Unclosed quote @ 342" Blach Fuck it... I'll jsut go hunt down the section of the PHP code the deals with this table an just set and absolute variable in the code and run it. I would have done that in the first place but its a huge piece of software and I figure Id try it like this first.... Thanks anyway. BTW SHould I have an EMPTY databse called "phpmyadmin" ??? |
All times are GMT -7. The time now is 07:40 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123