@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13



Comments:

<0> hi, is there a way to limit the amount of characters of a field a query will return? I've only managed to find how to limit the amount of rows returned
<1> bina: you can use SUBSTRING to do that
<1> !m bina string-functions
<2> bina: (String Functions) : http://dev.mysql.com/doc/mysql/en/String_functions.html
<0> Duesentrieb, sweet ill take a look. Thanks. I was almost there :) im currently on full text search functions :)
<3> I accidentally UPDATEd without a WHERE, can I backtrack with some transaction logs or something?
<4> are you using innodb?
<3> I'm not sure...
<3> Don't think so
<3> MyISAM I think
<3> anyone? :)
<5> one piece of advice: don't shut the mysqld server down :)
<5> you might be able to dig it out, i'm not aware of the specifics, sorry
<3> Yeah..
<3> I'll just do it myself then
<3> Thank god it was only like 90 records :)



<6> can restore from your last backup and re-run all the statements in the binary log up until the bad update.
<3> Yeah
<3> Too much h***le, i'll just do it the other way since there doesn't seem to be a way to backtrace..
<7> hi, i have a table contract and now i can have 2 kind of customers - a private customer & a wholesaler. is it better to put these 2 cusomers in one table with a flag (for ex. 1 is a priv. customer & 2 is the wholeseller?) . there wold be reundant field in this case, cause the wholeseller desnt need (for example)a field surname. or is it better to make 2 tables ?
<8> Hi anyone tell me how to upload a mysql txtfile using phpmyadmin
<7> sry, was disconnected, if someone did answer my question, would be nice, if s/he repaste it to me in a query
<9> noone did.. sorry
<7> oh, ok
<10> anyone around that'll help me with converting a mysql master-to-slave setup, to a multimaster setup ?
<11> frog, One table would b efine.
<1> nawty: all i can tell you is that replicating from multiple masters to one slave does not work, if that's what you want.
<7> will_: ok, thank you
<1> bidirectional replication should be possible, but that'S pretty much all i know about it.
<10> Duesentrieb: basically just wanted to do master-2-master, instead of master-2-slave.
<12> is there any sort of problem in deleting the root mysql user but using in its place one or more users of different names?
<1> yea... afaik that should work just like master slave - just set each up to replicate from the other. You have to avoid collisions in auto-increment fields though. I think I read somewhere to force on to odd and one to even numbers
<1> look in the docs
<12> so that I dont have just one root user with one p***word more then one person knows but give each user Iw ant to give root access an account they can login and have no one using the account named root
<13> auto_increment_increment
<13> and auto_increment_offset
<13> kib that's fine but why not also keep the account named root?
<1> nawty: ----^
<10> done those, @ Duesentrieb
<12> gleam-: might be better not to for security..or maybe I wll keep it and set it to some p***word no one will be told
<1> nawty: you know all i know then :)
<10> Duesentrieb: the problem is that my system is running, and it works fine setting up one way, just doesn't seem to replicate both ways.
<10> Duesentrieb: oh, :(
<13> did you change master on the current master to read from teh slave?
<12> its just I prefer to login to mysql using a common p***word across my mutiple servers but some servers I want to allow my admins on and one in particular I prefer to leave it private
<12> so I thoughtI should login to all using an account called kib instead and give similar acocunts to others who need them on a per server basis
<13> sure, that's fine
<13> i'd just keep root around with a tougher p***word
<13> some things might rely on it
<13> none i know of
<13> but hey.
<12> probably a good idea
<12> just wanted to check befor eI did this and found out doing so creates a bad karma or somehtin
<10> ok, another thing, mysql replication, if i want to reset the master, what do i have to do on the slave.
<10> do i stop the slave, reset the master, start the slave?
<14> muhahahahahahaha!
<13> stop the slave, reset the master, change master to on the slave, star thte slave
<13> is there a reason you'r eresetting the master tho?
<15> how do I test if a table exists
<15> I was thinking about SELECT null and LIMIT 0
<15> is there any better way?
<13> just do anything to the table and see if you get an error
<13> describe, show create, show table status, whatever
<15> ok
<15> thanks
<10> gleam-: 3gb of bin logs.
<10> although, i suppose i should re-set those automatically.
<10> 20 days should be fine. :)
<13> flush logs; purge binary logs to ....
<13> expire_logs_days
<13> etc
<5> ldas: "show tables like yourtable" also works
<16> I'm trying to help update a friends site and all I did was edit a row.. replaced a phone number.. from say 12345678 to 22345678 and now PHP is freaking out.. says Fatal error: Call to a member function on a non-object in /home/.cuddy/inta/intam***age.com/mod/userpage/index.php on line 308.. any idea what I did wrong to the database?
<1> mugger: nothing. something is wrong with the php program.
<1> mugger: or rather: it's missing a value for some variable and is not handling that gracefully. That *could* be cause by what it's getting from the database
<1> no way to tell without looking at the php code
<16> Duesentrieb: that really doesn't make sense because I have a table with about 40 other rows, and I can copy the EXACT data out of say row 20 and paste it into the one I've been working on it and it still fails, yet every other one works fine (using the exact same PHP code)



<13> look that's not a mysql error, it's a php error
<13> if your query is generating an error, we can help
<13> if your code is generating an error, #php can help
<16> gleam-: it just doesn't make sense, because my code works fine in the sense that everything worked great and it also works great on the other 20 rows.. the only thing I did was update a row via phpmyadmin and now the row I touched doesn't work.. everything else still works :\
<5> might be what i was experiencing earlier, charset problems
<5> what's the collation on the fields and table?
<5> phpmyadmin tells you on the structure page
<16> youho: mmm ok let me check that out
<5> i had it the other way round
<5> phpmyadmin worked fine but a query from a script didnt work
<16> youho: collation is atin1_swedish_ci
<16> sorry latin1_swedish_ci
<5> yeah figured
<5> that's the default
<5> you might wanna do something like
<16> youho: under structure it says that
<5> alter database mydb default character set latin1;
<5> + alter table mytable convert to character set latin1;
<5> helped me
<16> the second one?
<5> both of them
<16> mmm
<16> youho: second one didn't work, said you have an error in your mysql syntax
<16> mmm how would I tell it which database in that statement?
<5> you should be inside the database when you do it
<16> youho: how do I do that?
<5> are you using the mysql console?
<16> youho: yeah I did mysql -u username -p -h etc
<16> youho: and I already executed alter database mydb default character set latin1; and it said Query OK, 1 row affected (0.00 sec)
<14> :)
<16> what you smiling at :(
<17> mugger: alter database default charset does not do anything to existing tables, only new tables will be affected
<17> mugger: there is 1 other effect I think , Load data infile
<5> mugger do "use yourdb" first
<5> then you'll be in there
<16> youho: ok it worked, but same problem that row isn't liking something
<16> lokus: any idea what the problem could be then? basically I edited a friends database, only changed the text inside a row, and now the code (which works fine on everything else, and used to work fine for this row) doesn't like it anymore.. gives me a fatal error
<17> pastebin the code and the error message
<16> lokus: you want the php code? or whats inside the row that I changed?
<17> mugger: jsut the sql and the data in the row
<16> lokus: he has some retarded system set up, paid some guys in tasmania and they created the most redundant and retarded system known to mankind
<16> lokus: okay
<16> lokus: http://pastebin.com/717855
<16> lokus: bloody nightmare isn't it? I don't know how people who have the brain capacity to even put together a mysql database can decide to store a member directory like that
<17> mugger: echo is your friend, try to echo $data, and check what does unserialize($data); do, error could be there
<16> Its just so weird because if you go to: http://intam***age.com/mod.php?mod=userpage&menu=13&page_id=65 all the sections work, however Victoria (the one I'm trying to update) gives the error
<16> lokus: aye I'm just so afraid of this code, its so bizarre and complicated..
<16> lokus: its weird because that code works np, if you go to any other location its pulling it from the database fine.. even pulling from the table fine, however after updating victoria it just craps out
<17> my guess is that $data is not valid somehow, and $current_data is not valid since it is never created
<17> try to run the select separately from a mysql cli or phpmyadmin
<16> lokus: why would the rest of the site work then? because its using the same code
<17> echo the exact query inside the mysql_query() and and die mysql_error()
<17> maybe the id is wrong
<17> and no row contains the provided id
<17> then no data and $data becomes null
<16> lokus: I'm looking at the database and there's definately 68 Victoria
<17> you sure the php is usign 68
<17> maybe it does
<16> yeah because look at the url
<16> http://intam***age.com/mod.php?mod=userpage&menu=130803&page_id=69
<16> that works fine
<16> when you change page_id=68 thats when the error pops up
<17> but it is always better to check with or die mysq_error() and check how many rows returned
<16> mmmk
<16> I added or die(mysql_error()); and now all the ones that work have "Object" above the listing and the one that doesn't work, still says the same thing
<16> No errors
<17> time to check how many rows returned, is there a php mysql api for this
<16> mysql_num_row();
<16> lokus: well they all return 1
<16> lokus: including the ones that work, and the one thats broken
<16> lokus: so it means its getting something, because if the SELECT was failing mysql_num_rows would return 0
<17> correct, so the problem could be the $current_data issue
<16> its weird though, why would the code work fine for the rest of the rows?
<16> just doesn't make sense


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

grub-install debian md0
yaird knoppix
#lisp
ubuntu firestarter minimize
funny gaims
css surf bots
#perl
#awk
#web
gnome-volume-manager accessible to all



Home  |  disclaimer  |  contact  |  submit quotes