Jump to content

bh

Members
  • Posts

    238
  • Joined

  • Last visited

Everything posted by bh

  1. Hi, E.g. try to use the ord function to get the ASCII value of a character.
  2. Session handers uses databases eg with shared systems.
  3. Its strange. Has your PHP's user permission to write that path "$filePath"? (But it must generate a permission denied error message...) Is your error displaying options are enable (error_reporting and display error)?
  4. Hi, You can get the creation time of a file with the filectime function (Its not the same as creation time its "time of last inode change (Unix timestamp)", but is ok for you). [/size] [/size]Anyway your opendir/readdir example is ok, but glob is easier, yes.
  5. Hi, Theres a PHP function to make multithread, its pcntl_fork.
  6. Hi, You can fetch the datas with cURL or you can use streams (fopen or file_get_contets)
  7. Hi, First use Indexes to your searched columns (sl.users) and second use JOIN, it will be faster...
  8. Hi, With DATE_ADD function its simple: SELECT DATE_ADD(NOW(), INTERVAL 24 HOUR); DATE_ADD: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add
  9. bh

    date/week

    @thorpe: Yeah, youre right, but im only gave to Roee another solution. Anyway with DateTime class its more elegant.
  10. bh

    date/week

    Hi, without DateTime() class, in "native PHP" heres a bit complexer but interesting eg date('Y-m-d', strtotime('2010W30')); // 2010/30th week's monday $sw = strtotime('2010W30'); date('Y-m-d', mktime(0, 0, 0, date('m', $sw), date('d', $sw) + 6, date('Y', $sw))); // prev week's end
  11. bh

    Cloning a table?

    Hi, Maybe with TRIGGERS you can do that.
  12. Hi, with array_multisort() e.g. like this: $myarray = array(); $myarray[0] = array("5", "3", "6", "1", "3"); $myarray[1] = array("1", "8", "4", "2", "0"); $myarray[2] = array("9", "1", "0", "0", "5"); $myarray[3] = array("8", "7", "1", "5", "6"); $myarray[4] = array("0", "2", "4", "7", "9"); $myarray[5] = array("5", "5", "5", "7", "5"); $myarray_sort = array(); foreach ($myarray as $arr) { $myarray_sort[] = $arr[0]; } array_multisort($myarray, $myarray_sort); print_r($myarray);
  13. You dont understood me Change those field names and etc to constants that are correct at all.
  14. Yeah, subtitue your dynamic variables with constants. E.g change "TBL_LANG_KEY" to "lang_key"... and check in PHP your values, whether good/wrong. E.g your $_where_definition variable is a correct mysql where statement and etc...
  15. One of your query probably wrong: Try to test it with simple constants. If its good with sample values, than your dynamic php values wrong.
  16. Check your $res variable, probably your query(*) has an error. * Debug your query with simple constants example in phpMyAdmin.
  17. Hi, Post your code. The error message says that your $res is not an object.
  18. Any error? Anyway not session_start its session_start() . Before you use any $_SESSION variable, you have to call session_start() .
  19. Hi, http://en.wikipedia.org/wiki/Programming_style http://www.dagbladet.no/development/phpcodingstandard/
  20. Use while... $query = "SELECT `salt` FROM `user` WHERE `username` = '$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); while ($data = mysql_fetch_object($result)) { echo $data->salt; }
  21. Hi, You should fetch your query: http://php.net/manual/en/function.mysql-fetch-array.php
  22. Hi, SUBSTRING(string, offset, length) http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring Like "2010/07/12/abc" datas the conversion eg is: SELECT CONVERT(SUBSTRING(date_column, 1, 10), DATETIME) FROM table; -> date_column's content let there be here eg: '1980/01/01abcdef...' -> The result will be 1980-01-01 00:00:00 just like your another table value:
  23. Oh, sure... cuz the '\' -> you have to escape it 1st: $newfile = "C:/xampp/htdocs/newold/{$_POST['argument']}"; 2nd: $newfile = "C:\\xampp\\htdocs\\newold\\{$_POST['argument']}"; a better way that you create a simple filename from your $_POST['argument']
  24. 2nd: you need those brackets $newfile = "C:\xampp\htdocs\new\old\{$_POST['argument']}"; (Anyway this way of creating your newfile is not the best practice.)
×
×
  • 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.