Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. mysql_query("DELETE FROM findamatch WHERE NOW() - 3 HOUR > $timestamp") or die(mysql_error());
  2. You need to do a join, read more here.
  3. If you don't use brackets the IF statement will apply to a single line directly below it, if you want multiple lines correlated to that IF than you must use french braces.
  4. if(ereg('[^A-Za-z0-9]', $username)) { $message = "Please user uppercase & lowercase a to z characters"; echo "$message"; exit(); } if(ereg('[^A-Za-z0-9]', $password)) { $message = "Please user uppercase & lowercase a to z characters"; echo "$message"; exit(); }
  5. Just assign $text, from you example, to the xml... $query = "SELECT * FROM list"; $res = mysql_query($query) or die(mysql_error); while($arr = mysql_fetch_row($res)) { $text .= "\" deleted=\"0\">\n \n \n \n \n \n \n" } $file = "file.txt"; $fp = fopen ($file, "a+"); fwrite ($fp, $text); fclose ($fp); ?>
  6. From this post, you obviously don't have a clue about OOP. Please do a search on these forums and Google for discussions and tutorials about it.
  7. Have another column in your DB to keep track of when it was inserted and run either a cron job or scheduled task, depending on what OS your server is on, and if it's 3 hours or older, delete it.
  8. There's a lot of thread started on this topic, surely you can find something.
  9. These: if(strlen($username [code]if(strlen($password should be: [code]if(strlen($username) [code]if(strlen($password)
  10. w
  11. Wrong section, take a look here: http://www.phpfreaks.com/forums/index.php/board,104.0.html
  12. Try: $symbol_list = array("MCD", "^DJI"); $feed = GetQuote($symbol_list); echo $feed; $fp = fopen("drop.xml", "a"); fwrite($fp, $feed); fclose($fp); function GetQuote($symbol) { // Build xml result as we go $xml_result = "\n"; // Grab each stock symbol and concatenate it to $xml_result foreach ($symbol as $value) { $xml_result .= $value . "\n"; } $xml_result .= ""; return $xml_result; } ?>
  13. What is in $symbol and where does it come from? note: if you're not using a regex for the split, use explode(), it's faster. If you do use a regex use preg_split() $sym_list = explode(", ", $symbol);
  14. mysqldump
  15. That should work. You have session_start at the top of that page, correct?
  16. Can you give us an example of what dates are being submitted? Your code looks fine.
  17. If your whole goal is to create a back up, why not use the mysqldump command? $result is just a resource id for your query. You have to actually tell it to grab the results from the db, just like a regular query that you wan to echo on the screen.
  18. It would make sense If I used file_get_contents to use file_put_contents... lol
  19. A different version of samshel's: $arrFiles = array( "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.01.txt", "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.02.txt", "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.03.txt", "http://weather.noaa.gov/pub/data/raw/fp/fpus20.kwbn.scs.04.txt" ); foreach($arrFiles as $file) $t .= file_get_contents($file); $theFile= fopen("log/comment.php", "w"); fwrite($theFile, $t); fclose($theFile); ?>
  20. Heh, that's really cool (corbin you have a comma in your hyperlink, which gives a 404 in case someone couldn't figure that out)
  21. You should already have an auto-incremented id in your table (usually the primary key) so your records always have a unique identifier. If you have one then you don't even need to include it in the INSERT statement, hence the name auto-increment.
  22. I don't know what you could learn that would take 18 hours... I mean it's not a waste of time to learn this, but 18 hours seems way too long.
  23. Yeah, look very convenient. I have some stand alone browsers but they are very buggy. I have also used: http://www.tatanka.com.br/ies4linux/page/Installation, but the IE's version only goes up to 6 as of right now.
×
×
  • 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.