| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> it's fine if you use usr_login = now() <0> not if you use usr_login = 'now()'; <1> okay <1> Whole query: UPDATE bolted_users SET usr_login=now() WHERE usr_id=1 <1> doesn't go through at all in the mysql-prompt <0> eml: hrm.. I did this... mysql> create table bolted_users ( usr_id int(4) AUTO_INCREMENT , usr_login TIME, PRIMARY KEY (usr_id) ) ; <0> eml: then mysql> insert into bolted_users VALUES(Null, now()); <0> eml : then mysql> UPDATE bolted_users SET usr_login=now() WHERE usr_id=1 ; <0> Rows matched: 1 Changed: 1 Warnings: 0 <1> it works for me in the mysql-prompt too, but not in php <1> I'm out of ideas on how to debug this <0> put your php code in a pastebin and ask #php since the DB and SQL query is fine. <1> okay <2> "In addition, it is not a good idea to "double up" on indexes. In other words, don't put a Primary key non-clustered index on a column, and a clustered index on the same column (this is possible, although never a good idea)" , what does he mean with this? <2> i should not use compound indexes ? <3> This is probably a really stupid question, but why does my LONGBLOB field return things like "[B@14b6bed" in select statements? o_o
<1> http://pastebin.com/572414 <- query is on line 37 if you're interrested <4> Therion: why would i need a sense of humor over here? for your weird jokes? <4> Therion: but those are not funny <5> how do i stop it from beeping? <4> mute the sound <6> eml, would it work better if you freed the result after you formatted your next query? <1> bobfield, I thikn you found the error, seems like that query doesn't return a valid mysql result <6> Just thinking that $row might not hold anything meaningful after mysql_free_result is called <5> jpm <5> the beep is not coming from my speakers <5> its coming from the motherboard <1> bobfield, good point <1> bobfield, don't think that was it tho <6> no? hmmm... <7> chaps, I'm looking for some specific SQL query help <7> I have a field in a database that contains the html for a webpage <7> I need to write some sql the will remove all the <font face=blah blah> and </font> tags from it <7> removing the </font> tags is not a problem <7> but the opening <font face=X size=X etc> is a problem <8> Okay guys --- if I have a datetime field, and I want to query only the date (based on today) from that field how do I do so? <8> select * from table where date = current_date does not work <9> where date = cur_date() <8> That doesn't do it... <9> sorry, where dat_col = current_date(); <8> select * from table where date = current_date does not work <8> I tried that <6> select * from table where date_format(date,'%Y-%m-%d) = curdate(); <8> Works like a charm. <8> Thanks bob <6> you're welcome <9> is it a datetime? <6> ikonia, I came up with something but it only eats one instance <7> bobfield I'd appriciate any help at this moment in time <7> its a cms system with over 2000 records <7> so stipping font tags by hand is not an option <6> concat(left(@string,@pos:=locate('<font',@string)-1),right(@string,length(@string)-locate('>',@string,@pos))) <7> so stipping font tags by hand is not an option <10> sorry about that <10> cat jumped on laptop <10> bobfield can you say again please <6> concat(left(@string,@pos:=locate('<font',@string)-1),right(@string,length(@string)-locate('>',@string,@pos))) <10> and exactly what will that do <10> I'm just walking through it <6> eats from @string first instance of <font ... > <6> result of first locate is stored in @pos, used in second locate <10> so if I have 10 lines of <font> I'll have to run this 10 times per record <10> is that right ? <6> yes you'd have to run it iteratively <10> ok, so how can I use that against a specific table and firled <10> field <10> eg concat blah from table_field <10> if you see what I mean <6> update yourtable set yourfield = concat(...) <10> got you <10> ok <10> mega <6> until rows changed=0 <10> 881 rows effected ! <10> cool <10> oops <10> blanked the whole db
<6> did you substitute your field for @string ? <10> guess that needs a bit more consideration <10> yup <10> i'll have to re-check <6> hopefully yoi' <6> hopefully you've a backup <10> oh yes <10> test db <6> very smart idea <11> hgd <12> Hello <10> hey, can't rush in and start alerting data on a live db <10> I an drop this one all night <6> I run a small db right on my laptop, can lose the whole show if I like <12> How does mysql indexing works? For instance, I have a table with some columns like USER_NAME, USER_COUNTRY etc. Can I let it (the table) ordered by a specific column, like USER_NAME for instance or this ordering just occours on SELECT queries? <6> the query will work just fine without the index but the index can help the performance <12> but can I let the table data ALREADY indexed? I mean, instead of ordering in the SELECT query? <10> bobfield is it possible to expand the scope of that query <10> Degola: <6> you mean more than one field? <10> no <10> so its a little more generic <10> Degola: <6> ah <10> for example <10> left <font right=> and then remove everything in between <10> so it removes all <font %%%%% > tags <6> instead of just the first instance per row? <10> yeah <10> so any <font %$""$%> tags are removed <10> so the while field is stripped of any sort of <font> tag <6> I think that would need a stored function <6> with a loop <10> the sql equiv of a while loop <10> or <10> I could be lazy <6> REPEAT stmt UNTIL condition; <10> and just have something that did <6> REPEAT stmt UNTIL condition END REPEAT; <10> remove <font $everything until the first > <10> and run it a 100000 times <6> well I'm guessing this is a one-off cleanup operation? <10> yeah <10> updated to css <10> but due to custom tags <10> not all pages are the same <10> so I need to strip all font tags <10> so that all pages are foced to css <6> *nods <10> so it will be run once on the test db <10> and then once on live <10> once test is %100 <6> well a stored function might be just the ticket then if that's an option <6> run it once and be positive <10> sql is not my thing <10> I'm pretty basic <10> I can create/drop/update etc etc <10> but procedures and advanced sql is out of my league <6> Are you running V5? <10> yes 5.1.16 <6> How long are these strings in each row? <10> thousands of line <10> each row is a full html page <10> so could be 100 lines <10> could be 1000 lines <10> depending on how long the content of the page is <6> how are they declared, text? longtext? <10> mediumtext <6> okay <13> what's wrong with this: <13> SELECT M.*, P.label FROM metas M, pages P <13> WHERE P.action_id = ( select actions.id from actions where actions.name = 'splash' limit 1) <13> AND P.meta_id = M.id <13> LIMIT 1
Return to
#mysql or Go to some related
logs:
#linux Pyhton __slots__ he1ix #perl javascript datetime add days
zamba*meaning Class driver suspend failed for cpu0 pound GLIBC_PRIVATE #perl gparted unclean
|
|