Jump to content

bugmenot

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by bugmenot

  1. here is an actual output from my code :: [ User since : 30/07/2015 05:25 am ] when I expect to see :: [ User since :30/07/2015 03:25 am ] $user_req = mysql_query("SELECT regdate FROM users WHERE id='$user_id'"); if(mysql_num_rows($user_req)>0){ $user_info = mysql_fetch_array($user_req); echo 'User since : ' . date('d/m/Y H:i a',$user_info['regdate']) . '<br/>'; } and here is date setting in php.ini [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = Africa/Casablanca ; http://php.net/date.default-latitude ;date.default_latitude = 31.7667 ; http://php.net/date.default-longitude ;date.default_longitude = 35.2333 ; http://php.net/date.sunrise-zenith ;date.sunrise_zenith = 90.583333 ; http://php.net/date.sunset-zenith ;date.sunset_zenith = 90.583333
  2. yes, I know the the code does not match, it's just for showing the example
  3. Hello sorry for the English if it's bad I m working in XAMPP localhost v1.8.2, and the PHP version is 5.4.4 first here is the script $user_req = mysql_query("SELECT regdate FROM users WHERE id='$user_id'"); if(mysql_num_rows($user_req)>0){ $user_info = mysql_fetch_array($user_req); echo date('d/m/Y H:i a',$user_info['regdate']); } and the sql query that I use mysql_query('insert into users (username, password, email, regdate) values ("'.$username.'", "'.$password.'", "'.$email.'", "'.time().'")') the problem is that if registration date is [ 03:25:45 ] the output look like this [ 05:25:45 ] I don't know from where the 2 hours come from , I've tried in another script, I even reinstall XAMPP, but didn't work... Thanks
  4. Stupid mistake You Saved my life, thank you
  5. SELECT users.*, topics.* FROM `users` LEFT JOIN topics ON topics.topic_author = users.id WHERE topic.id=$tid order by topic_edit_time ASC didn't work, I get :: Unknown column 'topic.id' in 'where clause'
  6. Hello every one I m using a localhost ( XAMPP ) to run this qeury whene a run the query like this it works SELECT users.*, topics.* FROM `users` LEFT JOIN topics ON topics.topic_author = users.id order by topic_edit_time ASC but whene I add " WHERE " it doesn't SELECT users.*, topics.* FROM `users` LEFT JOIN topics ON topics.topic_author = users.id order by topic_edit_time ASC WHERE id='$tid' and Iget this error message :: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id=1' at line 1 please help Thanks, and have a good day
×
×
  • 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.