Jump to content

suncore

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

About suncore

  • Birthday 02/25/1989

Contact Methods

  • Website URL
    http://www.computeroot.com

Profile Information

  • Gender
    Male
  • Location
    Latvia, Riga

suncore's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry, 1 mistake in if statement will not change the meaning of DELETE. As I said, I wrote this in a new file ( in a rush ), so .. yeah, there might be something else I have done in the wrong way - don't judge me for these things. Questions a bit different from what you are trying to solve ??? More or less, looks like a bug or misconfiguration in my server setup ( though, I haven't changed anything "sensitive" ) - reinstalled php and now it works just fine ! ** How to mark a thread as SOLVED ?
  2. $found is not always true - depending on preg_match result, I set it to false/true ( not found / found ).
  3. *NOT* is not NOT - ok ? Regarding my code and forms - db contains only id, url and was populated by myself ( spider ). It has no forms, no chances to "inject" something, blah blah .. What I want to say is, it does what I said - instead of deleting rows, row count increases. Yes, if it would be an error, it would leave them as they are, but for some reason, it does something "impossible". I've rewritten this script to a new file and still, row count increases. Finally, I found that 1,2,3 .. rows are being added again at the end of my table .. basically, first row goes to the end, second row goes to the end, etc. - how it's possible and how to stop this crap ?
  4. Did you read my main post ? I wouldn't ask this "stupid" question just for fun - this is all what I have and instead of deleting something, row count increases. If you can't help, don't say "it's not possible" - as you see, it's possible and I don't know where's the problem ( I don't use any includes - all my code goes straight into this 1 file ).
  5. I've only 2 queries - SELECT & DELETE ( some part of useless code removed ) : <?php $sql = mysql_query("SELECT * FROM websites"); while ($data = mysql_fetch_array($sql)) { $url = $data['url']; $open = file_get_contents($url); // Now, try to find "for sale" ( code removed ) if ($found = true) { // Found - delete mysql_query("DELETE FROM websites WHERE url='$url'"); } else { // Not found - continue } } ?>
  6. Multidimensional arrays ( just an example ) : <?php $languages = array("lv" => array("alias" => "Latviešu", "image" => "images/flag-lv.gif")); echo "Text: " . $languages['lv']['alias'] . "<br>"; echo "Image: " . $languages['lv']['image'] . "<br>"; ?>
  7. I've a very simple table ( id, url ) which contains +/- 500,000 website url's ! Now, I want to delete all websites which are for sale - again, simple preg_match against "This domain/website is for sale". Now, when I try to delete these rows, instead of deleting, I get new rows ( and I'm not sure from where they come and how it's possible ). MySQL DELETE: mysql_query("DELETE FROM websites WHERE url='$url'"); What could be the reason and how to fix it ( DELETE should work as DELETE, not INSERT ) ?
  8. PHP have nothing to do with browser support, so - what's the problem ?
  9. PHP4 is history Anyways, problem solved ?
  10. I would go for an array ( array('email1@host.com', 'email2@host.com') ) and use for loop ( though, it's all about how you want to see it ).
  11. Form method POST and you want to get something via GET method ? Why ? If you want to get something from URL, use GET - if you want to get something from somewhere ( buffer ), use POST. As simple as that
  12. 1) Only 1/2 of your navigation bar is visible ( vertically ) 2) Video/slideshow is somewhere .. under the footer :-\ Looks like you've a lot of issues with your CSS code ( if any ). In case if you want to see it from my point of view, take a look at this picture : http://i39.tinypic.com/16bj98j.png ( screenshot from my pc ).
  13. Plain configuration file ( let's say system/config.php ) is what I prefer - easy to access, does not cause any performance loss ( usually caused by using mysql queries, etc. ) and more or less, easy readable ( in case if it's not a private script ).
  14. [*]XAMPP is running ? [*]Can we see your error log ?
  15. You may want to try this code ( just test it by changing unit count from 1 to 0 and so on .. ) : <?php $attributes = array('units' => 0); // Your array where unit equals to 0 ( ZERO ) $unit = $attributes['units']; // Assign array to a single variable if ($unit == 0 || empty($unit)) { // If 0 or empty echo "Error : unit field is empty or equals to zero!"; // Error } else { // If NOT empty and is greater than 0 ( 1,2,3 .. ) echo "Unit field contains some data "; // Success } ?>
×
×
  • 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.