GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Editing an mySQL database without a primary key? (https://gfy.com/showthread.php?t=218247)

- Jesus Christ - 01-07-2004 11:16 PM

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

toddler 01-07-2004 11:19 PM

you need to be very verbose in your update such that you have enough where clauses to make a discreet data set. Make sense?

Carrie 01-07-2004 11:20 PM

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?

- Jesus Christ - 01-07-2004 11:20 PM

Quote:

Originally posted by toddler
you need to be very verbose in your update such that you have enough where clauses to make a discreet data set. Make sense?
No....



dir listings have pretty colors.

Quote:

Originally posted by Carrie
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?

I only want to change the contents of one row... the wors are all different. Each row only has one value.

Babaganoosh 01-07-2004 11:20 PM

why would the primary key matter?

UPDATE TABLE SET column='value' WHERE column='value'

- Jesus Christ - 01-07-2004 11:22 PM

Quote:

Originally posted by Armed & Hammered
why would the primary key matter?

UPDATE TABLE SET column='value' WHERE column='value'

Yea I'll just launched putty to try command line.... Webmin is Giving me this BS about a primary key.

xxxoutsourcing 01-07-2004 11:24 PM

It's real easy to do in PHPMYSQL.

Carrie 01-07-2004 11:28 PM

Quote:

Originally posted by Armed & Hammered
why would the primary key matter?

UPDATE TABLE SET column='value' WHERE column='value'

If any of the other rows happen to have the same value, it'll change them too with this statement.

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).

JSA Matt 01-07-2004 11:30 PM

Quote:

Originally posted by Carrie

If any of the other rows happen to have the same value, it'll change them too with this statement.

Match it up better...

UPDATE table SET this_col='' WHERE col_one='' AND col_two='';

ps: http://www.phpmyadmin.net/

- Jesus Christ - 01-07-2004 11:33 PM

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.

Babaganoosh 01-07-2004 11:34 PM

Quote:

Originally posted by Carrie

If any of the other rows happen to have the same value, it'll change them too with this statement.

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).

Obviously. That's just an example. He's smart enough to narrow it down if he needs to.

BlueDesignStudios 01-07-2004 11:38 PM

get out of SQL, in unix type in: rm -r

& and that should do the trick

:2 cents:

Carrie 01-07-2004 11:39 PM

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. :)

- Jesus Christ - 01-07-2004 11:40 PM

Quote:

Originally posted by BlueDesignStudios
get out of SQL, in unix type in: rm -r

& and that should do the trick

:2 cents:

ITs going through a list of stuff really fast....

??

Whats it doing?

dotwind 01-07-2004 11:40 PM

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.

Carrie 01-07-2004 11:40 PM

Quote:

Originally posted by BlueDesignStudios
get out of SQL, in unix type in: rm -r

& and that should do the trick

:2 cents:

Feeling like having a death wish tonight when he wipes his server? :1orglaugh

dotwind 01-07-2004 11:42 PM

Quote:

Originally posted by - Jesus Christ -
ITs going through a list of stuff really fast....

??

Whats it doing?

don't worry it's just looking for what you wanted to do and would do it right now :glugglug

Babaganoosh 01-07-2004 11:43 PM

Quote:

Originally posted by BlueDesignStudios
get out of SQL, in unix type in: rm -r

& and that should do the trick

:2 cents:

:1orglaugh

toddler 01-07-2004 11:46 PM

Quote:

Originally posted by - Jesus Christ -
Yea I'll just launched putty to try command line.... Webmin is Giving me this BS about a primary key.

no cli? jesus typed man, no clicky of the mouse for him. you fuckimg imposter!

- Jesus Christ - 01-07-2004 11:48 PM

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