Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Sorry, this will work... (you don't need the strtotime() method) $rows['project_start'] = date("n/j/Y", $rows['project_start']); $rows['project_end'] = date("n/j/Y", $rows['project_end']);
  2. Is there an error? Do you even have error reporting on? Was it ever working? That's a lot of code to not have it working at one point. What did you change. WE NEED DETAILS....
  3. I assume you already have you form along with it's methods...? if(isset($_POST['subimt']) { echo ''; }
  4. Try this: $sql = "SELECT projects.*, categories.cat_name FROM projects INNER JOIN categories ON (projects.project_types = categories.cat_id) where 1"; $result = mysql_query($sql); while ($rows=mysql_fetch_array($result)) { $rows['project_start'] = date("n/j/Y", strtotime($rows['project_start'])); $rows['project_end'] = date("n/j/Y", strtotime($rows['project_start'])); //Should be project_end? echo ""; echo " ". {$rows['project_title']} ." ". {$rows['project_bids']} ." ". {$rows['project_types']} ." ". {$rows['project_city']} ." ". {$rows['project_state']} ." ". {$rows['project_zip']} ." ". {$rows['project_start']} ." ". {$rows['project_end']} ." "; }
  5. Sorry not too familiar with batch commands, have you tried system? system("SyncNow.bat"); Take a gander at this.
  6. Seems like you're using 2 different arrays... Where does $result[] come from? It should be: $rows['project_start'] = date("n/j/Y", strtotime($rows['project_start'])); FYI: 1228432870 is a timestamp.
  7. Hmmm, I see. kashthealien please describe your situation in a detailed manner so we can help you figure out a good solution.
  8. echo exec("SyncNow.bat");
  9. I can't think of a logical scenario to re-order auto-incremented id's... well,
  10. The one that didn't work didn't work because you put it on the wrong place Yeah, he probably put it in the while loop. Anyway, they are both pretty much the same thing, and both should work. I see...I did put it in the 'while loop' Doh! Lol! This is what I meant... while($row=mysql_fetch_array($res)){ $title=$row['Title']; $pubdate=$row['PubDate']; $description=$row['Description']; $content=$row['Content']; $source=$row['Source']; } $pubdate=date("j F, Y",strtotime($pubdate)); echo "Published" . $pubdate;
  11. The one that didn't work didn't work because you put it on the wrong place Yeah, he probably put it in the while loop. Anyway, they are both pretty much the same thing, and both should work.
  12. It sure would be, but, you could always run a cron job late at night to dump and repopulate the tables. kashthealien, what is the purpose of this, if you don't mind?
  13. Lol, I think he wants something a little more dynamic... The only way I can think of doing this is to dump your data to a temporary table empty the current one and repopulate the original table from the temp one. It will auto-increment everything back in order. But there's no way to INSERT a record and have it "fill in the gaps" of the auto-increment field, at least not to my knowledge.
  14. Not sure exactly what order that would be but after you run your query you just use mysql_num_rows to return the number of results. I understand you need a query for a search in 3 fields: headline summary story but I'm lost in what kind of order you want them returned.
  15. Have you tried: $pubdate = date("j F, Y",strtotime($pubdate)); echo $pubdate; ?
  16. Back to your original question, after you grab the contents just utilize regex, substrings, etc. to grab what you need. You need to figure out the structure of how they display their content first. You may want to look up something similar to screen scraping.
  17. You can set POST variables by doing something similar to this: curl_setopt ($ch, CURLOPT_POSTFIELDS, 'fieldname1=fieldvalue1&fieldname2=fieldvalue2'); Here's a snippet...
  18. Sorry for anyone who spent time trying to solve this issue. I learned that the problem was with the pertaining directory's permissions. It did not permit me to change the name of the file.
  19. I have a function that is supposed to write/update a file and, if the user clicks on the checkbox ($use), rename the file. Everything works fine until it invokes the rename method. I've closed the file handle, changed its mode to 777, tried to delete the file and create one but still gives the same "Permission denied" error. Any ideas what could be causing this? Thanks. Error: Code: function updateFile($name, $ids_array, $use) { $myFile = (file_exists($name.".old")) ? $name .".old" : $name .".txt"; $newFile = ($use != "") ? $name.".txt" : $name.".old"; $fh = fopen($myFile, 'w') or die("can't open file"); for($i=0; $i{ if($ids_array[$i] != "") { $stringData = "$ids_array[$i]\n"; fwrite($fh, $stringData); } } fclose($fh); rename($myFile, $newFile); }
  20. Are you using a reseller template? Could have sworn I've seen this same exact site before...
  21. I have a short delay, less than a second...
  22. Maq

    Query Help.

    Can you please: 1) echo out $query. 2) add or die(mysql_error()) to the end of your queries. 3) add this to the top of your script: ini_set ("display_errors", "1"); error_reporting(E_ALL); Not sure but I think you also need to do: if((awake+5) >= maxawake) {
  23. 1) Have no clue what you're asking. What do you mean change? You should be more detailed. 2) This has nothing to do with regex. Move this thread to the PHP Help thread.
  24. One problem. The date() function returns the seconds but with the leading zeros. So, in some cases, you're going to have extra characters.
×
×
  • 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.