Jump to content

kevin7

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by kevin7

  1. Hi all, I have been messing up with timezone lately. I solved most of the problems in PHP side, but I have a small issue with mySQL. I store created date in timestamp format using this php function: $date = explode('-', '11-01-2010'); $start_date = gmmktime(0, 0, 0, $date[1], $date[0], $date[2]); //then i store it into a column called start_time, varchar 255 and then, I retrieve it using this mySQL command: select * from event where active=1 and date_format(from_unixtime(start_time), "%d-%m-%Y")='11-01-2010'; but apparently, mySQL convert the date to 12-01-2010, not 11-01-2010.. it's the timezone problem. Normally, I would use for-loop, loop through the array and convert the timestamp stored in database using gmdate() function with php. But in this case, I have to do it with mySQL command. Does mySQL have gmdate() equivalent function? Many Thanks!
  2. I'm suck at foreach with multidimension array, I have this array structure: $item = array( 'chicken' => array('description' => 'a chick', 'quantity' => '5kg'), 'tomatoes' => array('description' => 'a tomato', 'quantity' => '0.5kg') ); and I will the output looks like this, it list out the item name only in a ul list - chicken - tomatoes this is the code i was using, it display "array" foreach ($item as $value => $key) { echo '<li><a href="#">' . $item[$value] . '</a></li>'; } } hmm, what went wrong? Thanks heaps
  3. I want to list all my files in a directory that has this pattern: profile-create, profile-post, navigation-list, or access-list-create all of them will have a hyphen in between two words this is the one im developing, but it isnt working. $files = scandir($basePath); foreach($files as $key => $value){ if (preg_match("/^[a-z]*[\-][a-z]*$/", $value)) echo $value . '<br/>'; } can anyone provide me a correct expression? thanks.
  4. substr function? http://au.php.net/strings
  5. hello all, i know there is a way to do this, something like pop up a message "Bye, see you around" after the user close the window or click to navigate other pages... what is the javascript event we use for that one? thanks.
  6. opening socket to get the mail is my alternative... really couldnt find any solution.. sigh... well... search hard...
  7. hmmm... another concern... any quick and dirty way?
  8. Hi, I have done some research on looking for a solution to detect bounced email. first of all, safe_mode for php must be OFF in order to use returnPath in mail() function. And this would be the first obstacle since most of the web servers have it ON. Anyway, my concept of detecting a bounce email is, set returnPath, and then write a php script to receive mail from the returnPath, and search for email title that matches "Undelivered Mail Returned to Sender", after that, process the content of the email, and should able to find the invalid email address and reason of undelivered. my concept... in my own opinion, feasible but impractical, is that anyway to detect bounced email? correct me if i am wrong. thanks!
  9. Hi! I have a question, I saw from a tutorial, but i couldnt understand this, what's the difference with the following: mysql_query(some_query_string) @mysql_query(some_query_string) what does the alias mean? and, i saw some of the functions in a class have something like this function getPageNav($queryvars = '') why do they assign $queryvars to nothing? in what situation we need to do this? thanks!
  10. hi saint959... yes it did, you need to get inside the cart... if two same products were added, it will show only 1... but if two different products were added, it will show 2... haha, but yea, it can be configured to ur way...
  11. Hi GuiltyGear... yea, i know... I dont have IE 7 installed... my computer is too lousy... I know I can do a lot of things to enhance it... this is just my own experiment, if I really published it online for business purpose, I will make sure it looks good in all the browsers not only IE... so don't worry, and thx dude..
  12. good critiques, I will work on it for my future project! I'm mastering CSS tableless coding now. Regarding to that Power Button... hehe, not good in graphic design hey? If you observe it deeply, it's actually a G rotated 90 degree anti-clockwise! So, I suppose to make a G in that sphere, and then.. yea why not make it look like a powerbutton instead.. haha... sorry if it made you puke... thank for all the critiques and compliments!
  13. I have just finished this, for my own research... It's a PHP Object-Oriented Shopping Cart + AJAX (partially) I used LyteBox (Good Stuff!), MySQL, PHP and CSS Tableless Coding! You can click on pictures, and the cart will update itself. It has a great potential to expand into bigger and complicated system. I did this with Mozilla, it doesnt look good in IE and I don't even bother to fix it. So, check it with Mozilla. http://www.roxes.net/oocart/ Please comment. Thanks
  14. I want to ask, what kind of solution I have for the payment part of a shopping cart system? How customer make the payment? I do some search online, some of the people using Paypal, can anyone of you tell me the most common used method? thanks!
  15. haha... yea, it was last year, i wasnt too good at css tableless coding... believe me, i can do that now... and that technique is really really helpful!
  16. www.thegigabit.com scale 1 to 10 plus critics, complements are always welcome : ) thanks
  17. i helped to do some search in google, this is pasted from one of the poster. so, i assume you hv set the id column to auto increment.. $query = mysql_query("SELECT MAX(id) FROM `table`"); $results = mysql_fetch_array($query); $cur_auto_id = $results['MAX(id)'] + 1; more detail on http://codingforums.com/archive/index.php?t-94437.html do search google!
  18. erm... not so sure about that, i dont think so you can do that in the form alone, you might the help of javascript (AJAX)....
  19. kristen: it depends on you, 3 of them will work, but the third once can save you some times. for my own preference, i use the second one. bubblebla: call data from table? i assume you mean from database's table.. not sure if my explanation is correct, normally, when u make a query, you will have something like.. $row = mysql_fetch_array($query); if you don't know the column name, you can echo the data like $row[0], $row[1].... if you know the column name, you can echo the data like $row['id'], $row['name']... if you use extract($row), you can straight away use it according to the column name, $id, $name... cheers...
  20. nah, it happed to me once, the server was located in US, and the competition was located in Australia, I miscalculated the time different, the competition closed earlier one hour.. oops... so, now im very becareful with the timezone.
  21. i hv restarted the apache server, now the include_path is correct, but it still displays the same error message? is it due to the new version of pear, it changed the DB.php's name?
  22. erm, php? you can add extra column in each of the record (username, password) or extra columns (login date, modified date) or for best database practise, make it another table, so it will be something like login(id,username,password,login_date,modified_date) id is the foreign key to your existing directory table.
  23. correct, date() function will returnt the server time instead of your local computer time, you can add or minus to make it right.
  24. or, you can do like this ".$row['1eA_2eB_uitslag']." that's the hard way... but hey, i didnt know we can do that using curly brackets!
×
×
  • 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.