Jump to content

Centrally

Active Members
  • Posts

    32
  • Joined

  • Last visited

Recent Profile Visitors

866 profile views

Centrally's Achievements

Seeker

Seeker (1/7)

15

Reputation

  1. UPDATE: This is my end working query if someone is on same road in future: "INSERT INTO `baza1` (`Datum Objave`,`Serija`,`Ime predmeta`,`Broj pregleda`,`cijena`,`Link do oglasa`,`Koeficijent`) VALUES (" & $datum1 & "," & $serija & ", " & $ime1 & ", " & $pregledBroj1 & ", " & $cijena1 & ", " & $pathlink & ", " & $koeficient & ") ON DUPLICATE KEY UPDATE `Broj pregleda`=" & $pregledBroj1 & ", `cijena`=" & $cijena1 & ", `Koeficijent`=" & $koeficient & "" I removed primary key and set unique ones to id and `Ime predmeta` which is checked for duplicate and decided upon for either updating or inserting. I would like to give big thanks for all of you here trying to help me find solution.
  2. First off all I am using MySQL and UDF >EzMySql. Now from your set of examples I have learned how to check if specific value in one field exist but I still don't know how to do next thing. So if I use UPDATE "tab" SET "col2" = 'mouse' WHERE "col1" = 'pig'; It does check table for pig and if found is set to mouse, but now if it wasn't found how to add it in a new row. Something like ELSE statement is what I'm looking for that would add new row if existing value is not found. @Zedna I don't understand this part of query: WHERE NOT EXISTS(SELECT 1 FROM table WHERE id = your_id) What this 1 stand for and what id/your_id should be placed here. @jchd I don't care about SQLi yet because this part of db should be manually uploaded to display website with charts few times a day, meaning no actual interaction with website itself. EDIT: What do you think about this approach? INSERT INTO table1 (`col1`, `col2`, `col3`, `col4`) VALUES ('val1', 'val2', 'val3', 'val4') ON DUPLICATE KEY UPDATE `col2`='val2', `col3`='val3', [...]
  3. Thank you for your answers I will respond back to this topic when I test your examples.
  4. I'm trying to use autoIT script to populate database but I bumped on one problem. What I need is query that would check if value in specific field exist (like serial name of product), if it exist than update selected fields or if not insert new value. This is initial query I have made: "INSERT INTO `Baza1` (`Datum Objave`,`Serija`,`Ime predmeta`,`Broj pregleda`,`cijena`,`Link do oglasa`,`Koeficijent` ) VALUES (" & $datum1 & "," & $serija & ", " & $ime1 & ", " & $pregledBroj1 & ", " & $cijena1 & ", " & $pathlink & ", " & $koeficient & ")" This query would only insert new data without checking if it already exist. I have tried to use replace query but I simply cannot understand it's format. I don't know how to select what field to check for duplicate and how to update other fields if criteria is matched. Any explanation or brief part of code example is highly appreciated. Thanks
  5. It doesn't really matter if link is same or not because all link extracted contain this info in their source, in my 2nd example at step $s_URL = $lokacija debug give correct link at $s_URL but than after $source = _INetGetSource($s_URL) step, it returns nothing. Edit: If I remove that part of link than all my generated links will be invalid Edit2: I just cannot believe that I didn't see double usage of subcategory. Everything is fixed now, thank you very much for all your help.
  6. It does contain it, $s_URL contain same address that is displayed in example above.
  7. So I'm making script that should source one website and read info I need from it. I can do it as straight request and it's working fine, but if I generate link of website with another script and pass it into this mining part it just return nothing. Hope someone can enlighten me whats mistake in code. If I do it like this (directly setting path) it works flawlessly. $s_URL = "http://www.njuskalo.hr/procesori/cpu-amd-sempron-3400-x64-am2-oglas-9288094" $source = _INetGetSource ( $s_URL) $string = BinaryToString($source) $cijena = _StringBetween($string, "cijena:", " kn") Local $zaDBcijena = StringStripWS($cijena[0], 3) MsgBox(0, "out", $zaDBcijena) But if do it as part of other script it simply doesn't work: procesor() Func procesor() Local $i = 0 $s_URL = "http://www.njuskalo.hr/procesori" $source = _INetGetSource ( $s_URL) $string = BinaryToString($source) Global $url = _StringBetween($string, '<div class="image"><a href="', '"><img class="img_var') $size = UBound ( $url ) While $i < $size $lokacija = $s_URL & $url[$i] otvaranje() $i = $i + 1 WEnd EndFunc ;~ //Pregledavanje oglasa Func otvaranje() $s_URL = $lokacija $source = _INetGetSource ($s_URL) $string = BinaryToString($source) $cijena = _StringBetween($string, "cijena:", " kn") Local $zaDBcijena = StringStripWS($cijena[0], 3) MsgBox(0, "out", $zaDBcijena) EndFunc Any ideas is highly appreciated. Edit 1: So after getting over code line by line over and over it's obvious that this line is not working but why it's still mystery: $source = _INetGetSource ( $s_URL)
  8. I've bumped on problem on sending controlclick to a minimized client. I'm trying to use ControlClick on netbalancer software to utilize net performance and I have to click on a few buttons when requirments are met. There is no controlID on any button, so I used coordinates, it will be run on only one pc with same resolution so using coords is not so hacky solution but now I want to make it work even if client is minimized. Using same method will only get button highlighted like mouse was howered over it but it wont be clicked. Do anyone of you have any idea how this can be done or what I'm doing wrong? Thanks for your time.
  9. Yeah it's working fine now, really thank you for your fast help.
  10. I've tried it and it simply does nothing. Something is not right.
  11. I've bumped on next problem: I have txt file with bunch of mails, and I want to write script that search for specific one and put it in other txt file. Example: Email1@gmail.com Email2@gmail.com Email3@yahoo.com Email4@hotmail.com Now what I want is to search if domain is @gmail and output entire mail in new file. I have tried StringInString but I have no idea what to do with number of place where is found line starting. I'm pretty sure this should be done with StringCompare but I seams not to be able to find anyone with similar task who have posted online about this. I would appreciate any help or idea you could have and could share with me. Thanks
  12. I'm not really sure about difference because I only compiled last source code I found, if you really want to find out what is different than try finding source code from 2008 and compare it to one from 2010.
  13. It is typo, and I got no idea how that line ended there, anyway thanks for pointing it out, I fixed it now.
  14. Well I know that error must lie somwhere inside my code but it's less effort just doing hacky way since it would take unnecessary much amount of time to debug it.(~7k lines of code)
  15. Well I manage to make it work in single form of what you posted but in my code which is quite big I couldn't get it to work via function. Because I had to delete 2nd line on multiple occasions during script conditions. However if I use this with function it will delete entire text which is really strange, and if I use it directly it's works. Anyway thanks for your quick responses and ideas.
×
×
  • Create New...