Jump to content

Darkness Soul

Members
  • Posts

    133
  • Joined

  • Last visited

    Never

Everything posted by Darkness Soul

  1. Yo, The fast/only way I think is using truncate.. date won't recognize the first format, so, you can't use date(); to convert directly.. truncate space, truncate '/' and ':', regroup the array values as you wish.. :) D.Soul
  2. I've learned to use joins to "group" tables, but my senior said the t1 style is more simple, so I gonna test and this performance was better then joins, but with stress test, I've look its not really true.. joins are stable, if a join use 3s to execute a query, it'll take 2.8~3.2.. but the other style of code may use 1s~8s.. so I keep with joins, to me they are easy and safe. But my question was about the use of LEFT JOIN, let me se how be clear.. hmm.. (finding words) If I have a news with image.. like: select a.*, b.image from tbnews a left join tbimages b on b.id = a.idimage ..and want to make it without joins.. like: select a.*, b.image from tbnews a, tbimages b where b.id = a.idimage ..! its work fine with inner join, but don't know how to use with left joins.. better now? :') i'm trying hard D.Soul
  3. Yo, :D I've been testing querys and come to a conclusion.. [b]a INNER JOIN b[/b] is slow then [b]FROM a,b[/b], at my search query, i've seen the timing.. using inner join, its take 0.8~s, using the other way, its take 0.6~s. ;) So, if I have this code t1 below, and go to make the code t2 below, how I do to use LEFT JOIN? [code]-- t1 Select * From a Inner Join b On a.id = b.id_a Left Join c On c.id = b.id_c -- t2 Select * From a, b, c Where a.id = b.id_a And c.id = b.id_c -- This is like inner, how do I a left here?[/code] Thank you.. :D D.Soul
  4. Yo, I'm with a little problem.. when I do a search into my corps table, it return many lines (like, if you search for "ab" it will return 3875), and I have an IF into my select: [code]SELECT     tbE.id ,     IF     (         palavrachave_vip LIKE "%ab%" ,         "V" ,         IF         (             tbE.cliente = "S" ,             "S" ,             "N"         )     ) AS vip FROM [/code] I need to take these result and count, how much "V" and "S" I have, because they use an different css to display of each other.. and I need to count how much i'll display per time to don't broke my layout.. like it: Page one can display: 8 result "N", or 5 result "V", or 6 result "S" or, 3 result "V" and 3 result "S".. Do you understood? I don't know if I take the idea clear to you.. Well, is it. Thank you.. D.Soul
  5. Hmm, understood! May I use this post to paste my full class to people help me? I think, I'm studing, and other people checking will help a lot, and don't remember if the rules allow it (going read it again).
  6. Yo, I'm trying to start dev with OO, so I'm build up a connection class, but have a question about functions. If I want do the function below, will it record in a variable with the same name as the function or will it work as function return? [code] class conexao () {     var $dados ;     function executa ( $comando )     {         $this->executa = @mysql_query ( $comando , $this->conexao ) ;     } }[/code] Thank you, D.Soul
  7. Yo, I'm with a problem here.. when I send a mail, some domains receive, others don't. Exemple, my webmail (at work) receive a mail, but my gmail and yahoo don't (the same, as CC) Is that a header problem? I think on it, so add lines to prevent it, but, don't work as well.. my header: [code]$mail_cabecalho  = 'From: Me <mail@domain.com>'. $eol ; $mail_cabecalho .= 'CC: Me <mail@google.com>'. $eol ; $mail_cabecalho .= 'CC: Me <mail@yahoo.com>'. $eol ; $mail_cabecalho .= 'Reply-to: Me <mail@domain.com>'. $eol ; $mail_cabecalho .= 'Return-Path: Me <mail@domain.com>'. $eol ; $mail_cabecalho .= 'Message-ID: <'. date ( 'm/d/Y H:i' , time() ) .' Domain@'. $_SERVER['SERVER_NAME'] .'>'. $eol ; $mail_cabecalho .= 'X-Mailer: PHP v'. phpversion () . $eol ; $mail_cabecalho .= 'MIME-Version: 1.0'. $eol ; $mail_cabecalho .= 'Content-Type: text/html; charset=iso-8859-1'. $eol ; $mail_cabecalho .= 'Contente-Transfer-Encoding: 8bit'. $eol ; [/code] Someone have a clue? Thank you.. D.Soul
  8. sorry, I don't understand.. left join tbAux on id_user is null ?
  9. Yo, :) I'm with a little problem. I have two tables, tbUsers and tbMail. When I send a mail to my users (like newsletter sys), I record the Mail id and the User id into tbAux. But, we have lots of users, and our server can't send it all at once, our script works like it: select 200 users who are not at the tbAux, send, wait a little time, reexecute. This select is my problem.. It return all the users in or not in tbAux.. :( My select string: [code]SELECT     DISTINCT     tbUser.id ,     tbUser.name ,     tbUser.email FROM     tbUser INNER JOIN     tbAux ON     tbAux.id_user <> tbUser.id WHERE     tbAux.id_mail = 6 AND     tbUser.status = 'A' AND     tbUser.email LIKE '%@%.%' AND     tbUser.id > 0 ORDER BY     tbUser.name ASC LIMIT     0 , 200[/code] I think its logical error, thank for any help. D.Soul
  10. Yo, I've tested it, it's kill the session for some reason, but not like I wanna =(.. [code]ini_set ( 'session.use_cookies' , true ) ; ini_set ( 'session.name' , 'the_sess__uniq_name' ) ; ini_set ( 'session.auto_start' , false ) ; ini_set ( 'session.gc_maxlifetime' , 5 ) ;  // in seconds, like: N + time() ini_set ( 'session.cookie_lifetime' , 5 ) ;  // in seconds, like: N + time() ini_set ( 'session.serialize_handler' , 'php' ) ; ini_set ( 'session.gc_probability' , 1 ) ; session_start() ;[/code] D.Soul
  11. Thank you Dest, but still "broke".. I've write this code at main.php page with the time set to 5 seconds, so I've tried to wait and reload. It was with the session data yet.. =( My login system use a session variable to hold the auth permission, so, the main redirect to the index when it "burn away".. :'( I'm without options.. another way? D.Soul
  12. so, is that correct? [code]// before start, in all files ini_set ( "session.gc_maxlifetime" , "2400" ) ; session_start () ;[/code] or should I use "session.cache_expire" ?
  13. yo, :D Guys, I've been look for a function to extend my session life time, unhappy, I don't found. By default, a session have 30 minutes as life time, but I need 40 minutes.. :-[ Thank you, D.Soul
  14. I think about use an aux table to record it with the PHP, and then, liten all compressed.. =) Thank you anyway ^^ D.Soul
  15. Yo, I need a little help, maybe its simple, but i don't know how to do it! At the index page, I have a table, with cars to be sold! like.. [table][tr][td]id ---[/td][td]36x ---[/td][td]60x ---[/td][/tr][tr][td]1 [/td][td]15[/td][td][/td][/tr][tr][td]1 [/td][td][/td][td]8[/td][/tr][tr][td]2 [/td][td]10[/td][td][/td][/tr][tr][td]3 [/td][td]25[/td][td][/td][/tr][tr][td]3 [/td][td][/td][td]12[/td][/tr][/table] What I'm suppose to do, to sum these rows, and return something like it?: [table][tr][td]id ---[/td][td]36x ---[/td][td]60x ---[/td][/tr][tr][td]1 [/td][td]15[/td][td]8[/td][/tr][tr][td]2 [/td][td]10[/td][td][/td][/tr][tr][td]3 [/td][td]25[/td][td]12[/td][/tr][/table] The data come from 3 tables, using joins.. someone know how i do to simplify this table? Thank you!! D.Soul
  16. Yo, I need a little knowledge help here (and it isn't with english ;) ).. I've build a AJAX function based in some tutorial, its work fine in simple places.. but.. I got a problem or two.. First: The page I've loaded with the fn_open_ajax(url,id); simple ignore ALL existing javascript.. this only execute the html and php.. Second: I try to use my function with ASP, but unhappy.. so my friend add an external group of try when the main page loads.. and its have more types of contro and the catch(), well, my function all catch(e) is with a simple 'e', they catch(e) is diferent to each one.. catch(ee), catch(E), ... What is this catch(eee), this 'e' inside.. err i've found is error.. but and e, ee, eee, eeee, E, EE... ??? If I 'union' these try with my function try.. maybe its work into asp too? Thanks :D D.Soul
  17. Yo, [quote author=hitman6003 link=topic=104258.msg415767#msg415767 date=1155590341] [code]$str = '[http://www.phpfreaks.com/]'; $str = trim($str, '[]'); echo '<a href="' . $str . '">' . $str . '</a>'; [/code] [/quote] Yeah, but this isn't the way i need it.. [quote author=Caesar link=topic=104258.msg415770#msg415770 date=1155590636] This will work: [code]<?php $contents = ':BOF: [http://www.phpfreaks.com/] :EOF:'; preg_match("/(http:\/\/)[a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/i", $contents, $links); echo"<a href=\"$links[0]\">$links[0]</a>"; ?>[/code] [/quote] This help too, but what i need is to replace that url inside a variable with the text line, so, when I print that line, its print the link as well.. and not the url alone.. =) an expemple: $var = 'this is the text line with [http://www.test.com] or [url=http://www.test.com]http://www.test.com[/url] url inside' ; the trim method don't leave to print this line with the second link.. and the [url][/url] is a better way to me to keep the url safe.. so, i think about use preg_replace, based on your post, caesar.. Bye, D.Soul
  18. Yo, I need a little help.. I'm supose to read from a file an url and show it as well.. like it: [code]:BOF: [http://www.phpfreaks.com/] :EOF:[/code] So, I need to remove these [ and ] to build something like: [code]<a href="http://www.phpfreaks.com/">http://www.phpfreaks.com/</a>[/code] I've tried eregi_replace, but I'm not good with regular expressions yet.. :( Thanks for any help.. D.Soul
  19. yeah, I know.. and this order is with a union inside the sql string.. but.. they want it, they get it.. =) D.Soul
  20. Hmmm.. thats a short one! What I've done to solute that problem was: [b]ORDER BY   vip DESC ,   IF( vip = 'V' , RAND() , IF( vip = 'S' , RAND() , nomefantasia ))[/b] It works fine as wished! =) D.Soul
  21. Yo, I have a col, VIP, and this one have my order method.. 'a', 'b', 'c'. I need to, randomize the data, after, order the randomized by this vip col.. after, i want to order the 'c' row by ASC, like this idea:     ORDER BY       RAND() ,       vip DESC ,       nome_fantasia ASC ( WHERE vip = 'c' ) Some solution? Thanks, D.Soul
  22. Sure!! =) [code]SELECT tbC.nome_fantasia, tbC.id FROM tbClientes_PJ AS tbC LEFT JOIN tbPastas_Andamento AS tbPN LEFT JOIN tbPastas_Andamento_Realizadas AS tbAN ON tbAN.id_atividade = tbPN.id ON tbPN.id_cliente = tbC.id LEFT JOIN tbPastas_Atividade AS tbPA LEFT JOIN tbPastas_Atividade_Realizadas AS tbAR ON tbAR.id_atividade = tbPA.id ON tbPA.id_cliente = tbC.id LEFT JOIN tbAprovados AS tbA ON tbA.id_cliente = tbC.id WHERE ( tbA.id_cliente IS NULL ) AND ( ( tbPA.tipo_cliente =1 AND month( tbAR.data_alterada_inicial ) =7 ) OR ( tbPN.tipo_cliente =1 AND month( tbAN.data_alterada_inicial ) =7 ) ) GROUP BY tbC.nome_fantasia [/code] D.Soul
  23. [b]SOLVED!!!!!![/b] Thanks anyway.. =)))) D.Soul ~~~~~~~~~~ I'm editing this post: My group leader (don't know how is called who is the project manager) give me a bad new.. this sql that I have the problem, use six table. Let me join you at the real-query problem.. I have that six table: 1. User data, all data 2. Task, all info about the task 3. Finished Task, info about the task that was finished with some manager entrys.. 4. Events, like task 5. Finished Events, like finished task 6. Checked Users Ok, my query will return ID and NAME from table 1, I've built like it: Users in t1, where have an entry in t2, where have this entry finished in t3, where have an entry in t4, where have this entry finished in t5, where is not checked yet in t6* *this one is the problem i've posted before This is an AND case, t2>t3 AND t4>t5, right? Now i ned an OR case.. to list it, t2>t3 OR t4>t5 OR both.. How i do this or inside the joins condition??? And how i correct the t6 problem without subquery? Thanks, D.Soul
  24. Yo, That's my problem: I have two table: 1. users - All user data 2. banish - user id and blob My query will show me all not-baned users, so, I need to list the users from table 1, testing the table 2, and showing only who isn't in the second table.. simple like that, hard like itsef.. never do something like it.. thanks, D.Soul
  25. Nops, This is a "public private" tool.. a lot of users may upload a lot of images.. You think about convert the charset? or something like it? D.Soul
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.