Query that returns two character records from MySQL table

Today I will show you how to get records of 2 characters that are mixed in with multiple character records. This particular example I experienced from my work. All 52 states in US each has 2 names: full name and abbreviation name. For example: California is a full name and CA is its abbreviation. However in Canada a state has only full name. For example: Manitoba. The issue here is that when you have a state table in your database that contains the states of…

Continue reading »

Saturday April 3rd from 9:00pm to 11:00pm PST

247Apps Scheduled Maintenance   We will be upgrading our infrastructure improvements to provide greater reliability and performance for our customers. From 9:00pm to 11:00pm PST, Saturday April 3rd, we will be conducting some hardware upgrades and security patches to our hosting platforms. Services for WordPress Website Builder Elementor, Rental Plugins, Housing Market Analysis, Charts, Custom Calculation, DownloadInsights customers will be affected. While you may continue to work in open applications, you may experience an interruption to web services during the maintenance period. We apologize for…

Continue reading »

How to view all files in a directory using php.

With PHP version 5.0 and higher, you can apply a function called dir_scan() to return all the filenames in a directory. $dir    = ‘dir_scan_test/’; $files1 = scandir($dir); print_r($files1); The list of filenames will be in an array. With PHP version 4.0 and lower, you have to use opendir($path) function to retrieve a list of files So, compared to PHP4, applying PHP5 codes will be much cleaner and therefore your scripts will be executed faster.

Continue reading »

MySQL Error Code 1215: “Cannot add foreign key constraint”

Why am I unable to create a constraint? The error message doesn’t help much. You just get the following line when you run this SQL statement: ALTER TABLE user_class ADD FOREIGN KEY (user_id) REFERENCES user(id); Error Code: 1215 Cannot add foreign key constraint If you try running some of these SQL statements from mysql ( https://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html#foreign-keys-adding ), still same error occurred without a reason. You may have to double check a few things within related tables and their fields. 1) The table or index the constraint…

Continue reading »

Error using pyttsx3 is a text-to-speech conversion library in Python

pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and 3. If running into this type of error for this pip library, you can uninstall the current version and downgrade the library, using these commands: You’ll see this notification in the console: Then try running this example again:

Continue reading »