Articles for March 2017

PHP PDO Database connection syntax | Blog

PHP PDO Database connection syntax

 Make connection.php file and insert following code in it, include this file wherever you need database connection(i.e Model file)

php free training in ahmedabad

<?php
try
{

$host=’localhost’;
$dbname=’YOUR_DATABASE_NAME’;
$user=’MYSQL_USERNAME’; //GENERALLY root FOR LOCALHOST
$pass=’MYSQL_PASSWORD’;    //GENERALLY BLANK FOR LOCALHOST

$dbo=new PDO(“mysql:host=$host;dbname=$dbname”,$user,$pass);
$dbo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);

}
catch(PDOException $e)
{
echo “database config2 connection error!”;
file_put_contents(‘config2.txt’,$e->getMEssage(),FILE_APPEND);
}

?>

PHP PDO Database connection syntax | Blog

The App is “PENDING PUBLICATION” what is that??

We love to help you host your android app on playstore.

Problem:

Platform: Android, Application Publish status

I uploaded a new app in my Developer account
When i published it , I found the app status “PENDING PUBLICATION”
What is that meaning?

 

 

 

 

Solution:

its a “Publishing status”

Near the top of individual apps’ pages on your Developer Console, you can see your app’s latest publishing status. Whether you’re publishing an app for the first time or making an update, you can use your publishing status to understand your app’s availability on Google Play.

Here are the different statuses that can be displayed for your app:

    • Draft: App hasn’t been published on Google Play.
      • Note: If the Publish app option isn’t available, click Why can’t I publish? for more information or check your app’s pages on the left menu to make sure you’ve included all required information for your app.
  • Pending publication: App is currently being processed for publishing.
  • Published: App is published and available on Google Play.
  • Rejected: App has been rejected and wasn’t published due to a violation of Google Play policies. More information about the violation is available near the top of your app’s pages on the Developer Console. Once you make a change to your app to address the violation, you can submit it again.
  • Suspended: App is suspended due to a violation of Google Play Policies (Content Policy, Developer Distribution Agreement). An email with details about the suspension is sent to the account owner.

It can take up to half hour to 2-3 days to get it published state from Pending publication status

PHP PDO Database connection syntax | Blog

Install any extension and site crashes and goes into maintenance mode. please help

 

Problem :

Platform: magento 1.9

 

When I try to install any extension, my site goes offline (maintenance mode).

 

 

I’m installing them through the magento connect manager.

 

An example extension would be http://connect20.magentocommerce.com/community/TBT_Enhancedgrid

 

I have some extensions previously installed.

 

I’m running  Magento CE ver. 1.9.0.1 on an ubuntu LAMP machine.

 

I’ve tried removing any unused modules and clearing var -> cache

 

What should I do?

 

learn magento

Solution :

As to Magento Connect not cleaning up after install and getting a 503 error, that’s pretty standard with Magento Connect installs. Find the file maintenance.flag in your Magento root directory and delete it. ( you can use filezilla FTP client to delete maintenance.flag file)

 

The maintenance.flag file puts Magento into maintenance mode and stops access to the site during module installation so the installer scripts that run after module installation can have half a chance to run properly on a busy website.

PHP PDO Database connection syntax | Blog

Search does not return results

Problem :

Platform : Magento 1.9 , Catelog search, Search
As i described in the title i don’t get any results when i search for a product. I have tried so far:

  1. Checking the visibility of the products
  2. My products are in stock
  3. I have also set the qty to 100 to be sure
  4. I have updated the products attributes under catalog->manage products-> select all products.
  5. I assigned all the products in the main website for my certain store view.
  6. The name attribute can be used for search.

I have also tried to search with the sku but nothing happens again. The odd is that the advanced search with both name and skuworks.

And my problem remains.. Any ideas on how to make my products to appear when searched??

 

This Solution works Perfactly:

I’ve experienced this. My fix was to go to Manage Products and select all products and perform an "Update Attributes" from the dropdown above the grid. In the Update Attributes screen, move to the Websites tab and re-associate with the proper website by checking the checkbox under Add Products To Website.

 

Screenshots to understand better :

Step 1: Go to Manage Products and select all products and perform an "Update Attributes"

 

Step 2: move to the Websites tab & check the checkbox for which store you want your search to perform.

Step 3 : Save.

Refresh Front-end website and Try to search product,you will find its working, Bingo!

PHP PDO Database connection syntax | Blog

PHP 7 Launched – Twice Faster that PHP 5.6

PHP 7.0.0 Release Announcement

The PHP development team announces the immediate availability of PHP 7.0.0. This release marks the start of the new major PHP 7 series.

PHP 7.0.0 comes with a new version of the Zend Engine, numerous improvements and new features such as

  • Improved performance: PHP 7 is up to twice as fast as PHP 5.6
  • Significantly reduced memory usage
  • Abstract Syntax Tree
  • Consistent 64-bit support
  • Improved Exception hierarchy
  • Many fatal errors converted to Exceptions
  • Secure random number generator
  • Removed old and unsupported SAPIs and extensions
  • The null coalescing operator (??)
  • Return and Scalar Type Declarations
  • Anonymous Classes
  • Zero cost asserts
  1. php project training

For source downloads of PHP 7.0.0 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

php7