php

MySql - Illegal mix of collations

Error on SQL Query

Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='

SQL Query Code:
SELECT ...FROM ...JOIN ...
 ON stats_visits.country  =  country.code

Quick SQL Query Fix:

PHP get Last Week Date

date() - Format a local time/date
strtotime() - Parse about any English textual datetime description into a Unix timestamp
array() - Create an array
list() - Assign variables as if they were an array

Add function description in Netbeans

Add class or function description in Netbeans
/**
* Class Mysql
*
* Misc. functions to play with mysql and mysqli as:

How to check if input id is a valid number?

ctype_digit() - Check for numeric character(s). Checks if all of the characters in the provided string, text, are numerical.
is_numeric() - Finds whether a variable is a number or a numeric string
is_int() - Find whether the type of a variable is integer
intval() - Get the integer value of a variable
round() - Rounds a float

PHP MySqli Prepared statements - Procedural Style

PHP MySqli Prepared Statements - Procedural Style


mysqli_stmt_init( $mysqli-link ) Initializes a statement and returns an object for use with mysqli_stmt_prepare
mysqli_prepare( $mysqli-link, $query ) Prepare an SQL statement for execution

PHP MySQL Improved Extension

in

PHP MySQL Improved Extension (mysqli)

mysqli Class

date(): It is not safe to rely on the system's timezone settings

PHP 5.3 and  date(): “It is not safe to rely on the system’s timezone settings”

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
 

 

Parse error: syntax error unexpected version (T_STRING)

Parse error: syntax error, unexpected 'version' (T_STRING) in /yourpage.html on line 1
<?xml version="1.0" ?>
 

This mean you have short_open_tag on in your php.ini

 

You can edit your php.ini file and change settings to

 

short_open_tag = Off

 

more info from php.ini

 

MySQLConverterTool

MYSQL to MYSQLI - MySQL Converter Tool

MySQL ext/mysql->ext/mysqli Converter Tool. This tool helps you to migrate PHP files using the PHP MySQL extension to use the MySQLi extension.

https://github.com/philip/MySQLConverterTool

PHP MySQL Limit Data

MySQL LIMIT syntax

The LIMIT clause is used in the SELECT statement to constrain the number of rows in a result set.
The LIMIT clause accepts one or two arguments.

Select  all records from 1 tm 25  from table called "Customer".
  $sql = "SELECT * FROM Customer LIMIT 25";
SQL query will return the first 25 records.
 

Syndicate content
Bespaar continu