PHP is executed at the server-side and thus does not know about clients, browsers or windows of those browsers. Some options though: Close button Close using java script
All posts by
.Using Strings-Basics
Escape Characters In both types of string: In ” ” strings: Note, using say ‘\n’ will not create a newline character, it will create the characters \n !!!!! \n only works in a “” string!! Joining strings Use the period character ‘.’ You can also use .= Is String Is String Empty Length ‘ vs […]
Debugging PHP
Useful debugging things Debugging arrays Display errors Add “display_errors = On” in your PHP configuration file to cause errors to be displayed. This is a really useful debugging feature and is often the best first step of debuigging to determin why something isn’t working. Turning on in a file Tip: Look for a error_log file […]
PHP Server General
Get Server Info <?php phpinfo(); ?>
.General PHP
Get PHP Info <?php phpinfo(); ?> Die (Exit page at this point) if (some_problem) { echo “There was an error.”; die(); }
Checking For Null Values
This will cause an error in code if reader1[0] is null: SomeVariableName += Convert::ToInt32(reader1[0]); Use this to detect if it is null: if (!reader1->IsDBNull(0)) SomeVariableName += Convert::ToInt32(reader1[0]);
Count Results
Total Number Of Some Column SELECT COUNT(SomeColumnName) FROM SomeTable WHERE … SELECT SomeColumnName, COUNT(SomeColumnName) FROM SomeTable WHERE … GROUP BY SomeColumnName //You can read it like this TotalVideosInSection = Convert::ToInt32(Row[0]); Total Number Of Rows SELECT COUNT(*) FROM SomeTable WHERE … Sum Of Some Column SELECT SUM(SomeColumnName) FROM SomeTable WHERE … Total Number Of True SELECT […]
GROUP BY
Group By Allows You To Return Results Grouped By A Certain Value Which Rows Share. Returns Total Number Of Rows For Each Value Present array ^Value = gcnew array(0); array ^MatchingRows= gcnew array(0); SqlClient::SqlConnection ^SqlConnection1 = gcnew SqlClient::SqlConnection(); SqlConnection1->ConnectionString = DataSourceString + DatabaseConnectionString; SqlConnection1->Open(); SqlClient::SqlCommand ^SqlCommand1; SqlCommand1 = gcnew SqlClient::SqlCommand(); SqlCommand1->Connection = SqlConnection1; SqlCommand1->CommandType = […]
NULL
Null Usage Examples WHERE DeletedDate IS NULL
WAITFOR
Use to block execution. While executing a WAITFOR statement the transaction is running and no other requests can run under the same transaction. Bear in mind that if the server is busy the thread may not be immediately scheduled. —-Delay for 20 seconds WAITFOR DELAY ‘000:00:20′ SELECT ’20 Second Delay’ GO —-Delay till 7 AM […]
