| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> ok well i'm using this syntax which is workin on my test server on my pc but not live on my host: UPDATE table_name SET col_name = 'value' WHERE col_name = 'value' AND col_name = 'value' <1> ummm <0> the host server is using MySQL ver. 4 <2> show the actual query. <2> and the full actual syntax error <2> on a pastebin. <0> UPDATE ".CIH_USER_TABLE." <0> SET currency_value = '".$new_cv."' <0> WHERE user_id = '".$userdata['user_id']."' <0> AND currency_id = '".$currency_id."' <2> ug. <3> oooh <3> too slow infi <2> spoke too late. <1> too late <0> sorry i'm new to irc and dont really know how to use it
<2> http://hashmysql.org/paste/ <0> and there is not error given it just doesn't update the table <1> maybe there's nothing matching your rules <1> I mean .. maybe there is no row in the table that has user_id AND currency_id both equal to the values you submit <0> there should be, it works on my pc <0> both the table on my pc and the live table on the host are set up the same way <2> .. with identical data, too? <0> not identical but they may as well be <2> ok, then do you get anything back from the corresponding SELECT statement, i.e. SELECT * FROM table WHERE user_id = 'whatever' and currency_id = 'whatever'; i.e., THE EXACT SAME WHERE CONDITION. <1> well perhaps I'm mistaken .. but I'm sure that if there's no error ... the only possible explanation is there is no mathcing condition <0> i do get the data back from the SELECT queries <2> then I'd print your query out exactly as it is, with all variables interpolated, right before submitting it to the server, and then run that query by hand. <1> is there any possibility that CIH_USER_TABLE refferes to another table with the exact same structure? do you have identical tables (regarding structure) in your db? <0> no other table has the same structure as CIH_USER_TABLE <2> just print out the interpolated query and check it against the data. <0> ok <0> i take it by interpolated you mean replacing the variables with set values? <1> just echo the query <0> ah ok, then it looks like this http://hashmysql.org/paste/viewentry.php?id=1863 <1> so if you run: Select currency_value from test_cih_user_currency WHERE user_id = '2' AND currency_id = '837jjhUHU4' .. does it output any result? <4> I can't drop an UNIQUE, it's giving me a 'can't rename table' (errno 150) <4> anyone have a mysql error to meaningfull message translator? <0> yes the result is 0 which is the default for the colume <0> when i run the command with the values in http://hashmysql.org/paste/viewentry.php?id=1863 it works fine though <4> ('meaningful', even) <0> and the output then becomes 75 <1> so if you run the query you pasted there .. it works? <0> yup <1> and the query you pasted there was obtained by echoing the first query you pasted here? <0> yeah <1> I don't know what to say ... if you copy pasted the exact same query .. it doesn't make sense ... perhaps you have a spce or something in your varibles .. the only other explnation I see .. is that you don't execute the query .. wich is also imporbable <0> i'll put up the php code for you to see <1> if you want to <0> http://hashmysql.org/paste/viewentry.php?id=1864 <1> and every other query on that page works I presume? <5> man i wish "drop trigger IF EXISTS" was added :( <0> it does yes <6> what is the difference if i say: select a from R r1 where exists (select * from r where a = r1.b) and select a from R where b = any(select a from r) <0> if it didn't then there wouldn't be any values in the last query <1> on line 48 <0> yeah? <1> is db->sql_query supposed to return false if an update query didn't update anything .. or failed? <0> failed <1> can you do a mysql_num_rows after that to see the number of affected rows ? <0> i'll check it out now <6> are these two queries equivalent anyone? <3> mysql_num_rows != affected rows <3> use mysql_affected_rows <1> yes affected_rows sorry <0> ah ok <6> select a from R r1 where exists (select * from r where a = r1.b) <6> is this the same as <6> select a from R where b = any(select a from r) <7> gleam_: still not working <7> gleam_: same error message <3> what"/ <3> who are you? <3> what? <3> oh that <3> mysqld really isn't running? <3> pgrep mysqld?
<7> gleam_: mysql4 on mac os x throught darwinports (from sources) - mysqld is not working <7> gleam_: defeat:~ phretor$ ps aux | grep sql returns the postgresql8 line <3> oh lord <3> osx <3> bleh <3> you should download the binaries from mysql.com <3> fo soh. <7> gleam_: no <3> sho <3> yes <7> gleam_: I should <3> yes you should <7> but I've heard about users able to make it working in that wat <7> way <7> I'd never us binaries <7> s/us/use <8> Hi there <3> then good luck <8> newbie question: is it possible to search for a certain entry like "home/httpd/" in the mysql databse and automaticaly replace it with smthg else like "/var/www/" ? <3> update mytable set mycol=replace(mycol,strtoreplace,whattoreplaceitwith) <8> cheers <8> i'll try it now <8> hum, i tried this: update mytable set mycol=replace(mycol,/home/httpd/vhosts/,/var/www/vhosts/) <0> ok i've tried that and i'm getting this error http://hashmysql.org/paste/viewentry.php?id=1865 <8> and got an error message: <8> ERROR: Unknown Punctuation String @ 58 <8> STR: /,/ <8> SQL: update mytable set mycol=replace(mycol,/home/httpd/vhosts/,/var/www/vhosts/) <8> any tip? <1> Nalum: did you use mysql_affected_rows or a method provided by your database abstraction cl***? I thin you should use the latter <3> strings <3> strings get ''s <1> Awillys, the parameters of replace must be between " " <8> okay cheers <1> the string actually as gleam_ says <8> and what about "mytable", shall i replace it by a table name? <0> cupa: i used mysql_affected_rows, i don't know how to get the method from the database abstraction cl*** <8> i want to do it over the whole database, all tables <0> cupu* <3> then run it for each table. <3> mycol should be the column name, also <6> are these two queries equivalent <6> (select * from R) intersect all (select * from S); <1> Nalum: well .. look into the actual cl*** file and search for an apropiate method .. or if it's a publicly available cl*** tell me what it is so and I'll look to see what method you should use <6> (select * from R) Natural Join (select * from S) <6> anyone please because not sure if intersect ALL allows duplicates like a natural join or does all operate on set semantics <6> hello anyone here know ? <6> does the oeprator ALL eliminate duplicates??? <9> hi im having problems with syntax: SELECT username, p***word FROM users WHERE username=".$_POST['user']."" <1> lilkid: first of all never use that query .. secondly .. what's the problem/error? <1> also the value you're comparing too should be between either ' ' or " " whatever works better for you .. and don't use that type of query because it's very prone to sql injection <1> try something like $sql = sprintf("Select username,p***word from users where username='%s'",addslashes($_POST['user'])); that's the minimum you should do <9> cupu: sorry i don't usually work with mysql. it returns an error: <9> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 <10> people say that 64bit cpu is better that 32 for mysql... but what is best... dual core CPU or singel core ? <9> cupu: ah but magic_quotes it turned on in php <9> s/it/is <11> Can someone help me i have a small issue with mysqldump <11> Iam trying to dump from an 3.23 Mysql server <1> lilkid: well then that would be equivalent .. even though it's not enaugh .. if you move your code to another server you're in big trouble .. don't get used to that <11> mysqldump: mysqldump: Couldn't execute '/*!40100 SET @@SQL_MODE='MYSQL323' */': Query was empty (1065) <1> otherwise just add ' ' to the usernam val <11> Anyone ? <1> how do you run mysql dump? <12> I have a design question. If you have web based software that allows for possibly thousands of users to add a good amount of data, is it better for each user to have a database, use one table for each individual or not worry about it and have everyone use the same tables? <13> mysqldump <10> mysqldump -u user -p db > outputfile <11> mysqldump -h cbitworld.com -f --compatible=mysql323 -v -u cbitworld -p cbitworld <1> and the server is what version? <12> speed is my main concern I guess <14> iamchaos it's better to use one table and follow the normalization forms up to 3nf <11> i think 3.22.32 <1> well then try to loose the compatible directive .. see if it works that way <11> it gives the same err
Return to
#mysql or Go to some related
logs:
yann117 sybersol thinkpad caplock problem wilymage ubuntu mounting-root-file-system install-cd #debian imagemagick /bin/sh: bad interpreter: Permission denied ati-flgrx gentoo module-rebuild edubuntu probleme resolution reconfigure dpkg
|
|