select timediff(now(),convert_tz(now(),@@session.time_zone,’+00:00′));
Related Articles
Best way to loop through a PHP mysql Resultset
If you want to loop throuh the mysql result set twice then use below way. $result = mysql_query(“SELECT * FROM my_table”);while($row = mysql_fetch_assoc($result)) {// inside the loop} The problem is, if you want to loop through the same result set again, you will get an error because the internal pointer is currently at the end […]
Search and Retrieve Data from MySQL DB Using PHP
Below is the Simple PHP and MYSQL Search Program. Use below database queries: CREATE TABLE IF NOT EXISTS user (id int(10) NOT NULL AUTO_INCREMENT,Name varchar(20) NOT NULL,PRIMARY KEY (id)); INSERT INTO user (id, Name) VALUES (‘1’, ‘vicky’), (‘2’, ‘vivek’); Below is the sample program:
10 Mistakes Which PHP MySQL Developers Make
1. Using MyISAM rather than InnoDB MySQL has a number of database engines, but you’re most likely to encounter MyISAM and InnoDB. MyISAM is used by default. However, unless you’re creating a very simple or experimental database, it’s almost certainly the wrong choice! MyISAM doesn’t support foreign key constraints or transactions, which are essential for […]