$aEventsSelect = Engine_Api::_()->getItemTable(‘event’)->select(); if(count($aEventIds) > 0){ $aEventsSelect->where(“event_id IN (?)”, $aEventIds); } if( $filter == “past” ) { $aEventsSelect->where(“endtime <= FROM_UNIXTIME(?)”, time()); } else { $aEventsSelect->where(“endtime > FROM_UNIXTIME(?)”, time()); } if($eventdate != ‘0’) { $whereSql = “‘{$eventdate}’ BETWEEN DATE(starttime) AND DATE(endtime)”; $aEventsSelect->where($whereSql); }
Category: SQL
How to print all sessions currently set in PHP
Using the following following code to get all sessions in current working environment echo ‘<pre>’;var_dump($_SESSION);echo ‘</pre>’;
mysql concatenate update query
We can append datat to the existing data in mysql field. Column name is email and value is “info@smarttips.com” UPDATE `engine4_users` SET email = CONCAT( email, ‘_test’ ) After the query execution the _test dat will be appended to email Output:info@smarttips.com_test
copy data from one mysql field to another mysqlfield
Mysql have this option to copy one field data to another field. For this purpose run a simple query. $UserlevelMigrationQuery = “UPDATEusers SET level_id = ‘4’, preunii_email = email, migration_date = NOW(), email_verify = ‘0’ WHERE level_id = 7″; $UserlevelMigrationResult = mysql_query($UserlevelMigrationQuery, $connection) or die(mysql_error());
.htaccess redirect not working apache
1.Configure apache mod_rewrite,run in terminal a2enmod rewrite 2. add the following code to /etc/apache2/sites-available/default DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> 3.Restart apache /etc/init.d/apache2 restart