<< < 11 12 13 14 15 16 17 18 19 > >>   Sort: Rank

Timeout Period on Session Values in PHP
What Is the Timeout Period on Session Values in PHP? The PHP engine has no direct settings on session timeout period. But it has a session garbage collection mechanism that you can set to remove those special files containing session values. There are 3 settings you can use to define the session gar...
2016-10-25, 287👍, 0💬

Setting session.gc_maxlifetime Properly in PHP
How To Set session.gc_maxlifetime Properly in PHP? As you know that session.gc_maxlifetime is the session value timeout period. You should set this value based on the usage pattern of your visitors. Here are some suggestions: # Set it to 20 minutes for a normal Web site: session.gc_maxlifetime = 120...
2016-10-24, 341👍, 0💬

Setting session.gc_divisor Properly in PHP
How To Set session.gc_divisor Properly in PHP? As you know that session.gc_divisor is the frequency of when the session garbage collection process will be executed. You should set this value based on the income request traffic. Here are some suggestions: # Set it to 10, if traffic is less than 10,00...
2016-10-24, 326👍, 0💬

Testing the Session Garbage Collection Process in PHP
How To Test the Session Garbage Collection Process in PHP? In order to test the session garbage collection process, you need to change the settings to expire session variables in 10 seconds and run the process on every request: session.gc_probability = 1 session.gc_divisor = 1 session.gc_maxlifetime...
2016-10-24, 307👍, 0💬

Removing Values Saved in the Session in PHP
How To Remove Values Saved in the Current Session in PHP? If you want to remove values saved in the current session, you should use the unset() function on those saved values in $_SESSION, or use array() to empty $_SESSION: unset($_SESSION['MyColor']) - Removes one value named MyColor in the current...
2016-10-24, 289👍, 0💬

Determining If a Session Is New in PHP
How To Determine If a Session Is New in PHP? There is not direct way to tell if a session is new or old. But you can design your site to have a required session value in all sessions. Then you can check the existence of this value in a session to determine if it is a new session by isset($_SESSION['...
2016-10-24, 284👍, 0💬

Working with MySQL Database in PHP
Where to find tutorials on how to work with MySQL Database in PHP? A collection of tutorials to answer many frequently asked questions on how to Work with MySQL Database in PHP. Clear explanations and tutorial exercises are provided on connecting and selecting MySQL database, creating and dropping t...
2016-10-22, 635👍, 0💬

What Is session_register() in PHP
What Is session_register() in PHP? session_register() is old function that registers global variables into the current session. You should stop using session_register() and use array $_SESSION to save values into the current session now.   ⇒Understanding and Using Sessions in PHP ⇒⇒PHP Tutorials
2016-10-22, 486👍, 0💬

Using MySQL Command Line Interface in PHP
How To Use MySQL Command Line Interface in PHP? MySQL server comes with a command line interface, which will allow you to operate with the server with SQL statements and other commands. To start the command line interface, you can run the \mysql\bin\mysql program. The tutorial exercise below shows y...
2016-10-22, 322👍, 0💬

Installing MySQL Server in PHP
How To Install MySQL Server in PHP? MySQL is an open source database management system developed by MySQL AB, http://www.mysql.com. You can download a copy and install it on your local computer. Here is how you can do this: Go to http://dev.mysql.com/downloads /mysql/5.0.html.Select the "Windows" an...
2016-10-22, 306👍, 0💬

Closing a Session Properly in PHP
How To Close a Session Properly in PHP? Let's say you site requires users to login. When a logged in user clicks the logout button, you need to close the session associated with this user properly in 3 steps: Remove all session values with $_SESSION = array(). Remove the session ID cookie with the s...
2016-10-22, 296👍, 0💬

Connecting to a MySQL Server in PHP
How To Connect to MySQL from a PHP Script in PHP? If you want access the MySQL server, you must create a connection object first by calling the mysql_connect() function in the following format: $con = mysql_connect($server, $username, $password); If you are connecting to a local MySQL server, you do...
2016-10-20, 663👍, 0💬

Selecting an Existing Database in PHP
How To Select an Exiting Database in PHP? The first thing after you have created a connection object to the MySQL server is to select the database where your tables are locate, by using the mysql_select_db() function. If your MySQL server is offered by your Web hosting company, they will assign a da...
2016-10-20, 614👍, 0💬

Inserting Rows Based on SELECT Statement in PHP
How To Insert Rows Based on SELECT Statements in PHP? If want to insert rows into a table based on data rows from other tables, you can use a sub-query inside the INSERT statement as shown in the following script example: &lt;?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_links" . ...
2016-10-20, 576👍, 0💬

Creating a Table in PHP
How To Create a Table in PHP? If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script: &lt;?php include "mysql_connection.php"; $sql = "CREATE TABLE fyi_links (" . " id INTEGER NOT NULL" . ", url VARCHAR(80) NOT NULL" . ", notes VARCHAR(1024)...
2016-10-20, 333👍, 0💬

What Is a Result Set Object in PHP
What Is a Result Set Object in PHP? A result set object is a logical representation of data rows returned by mysql_query() function on SELECT statements. Every result set object has an internal pointer used to identify the current row in the result set. Once you get a result set object, you can use ...
2016-10-20, 302👍, 0💬

Running a SQL Statement in PHP
How To Run a SQL Statement in PHP? You can run any types of SQL statements through the mysql_query() function. It takes the SQL statement as a string and returns different types of data depending on the SQL statement type and execution status: Returning FALSE, if the execution failed. Returning a re...
2016-10-20, 300👍, 0💬

Creating a Database in PHP
How To Create a Database in PHP? A database in a MySQL server is a logical container used to group tables and other data objects together as a unit. If you are the administrator of the server, you can create and delete databases using the CREATE/DROP DATABASE statements. The following PHP script sho...
2016-10-20, 299👍, 0💬

Number of Rows Affected by a SQL Statement in PHP
How To Get the Number of Rows Selected or Affected by a SQL Statement in PHP? There are two functions you can use the get the number of rows selected or affected by a SQL statement: mysql_num_rows($rs) - Returns the number of rows selected in a result set object returned from SELECT statement. mysql...
2016-10-20, 297👍, 0💬

Information Needed for MySQL Connection in PHP
What Do You Need to Connect PHP to MySQL in PHP? If you want to access MySQL database server in your PHP script, you need to make sure that MySQL module is installed and turned on in your PHP engine. Check the PHP configuration file, php.ini, to make sure the extension=php_mysql.dll is not commented...
2016-10-20, 293👍, 0💬

Inserting Data into a Table in PHP
How To Insert Data into a Table in PHP? If you want to insert a row of data into a table, you can use the INSERT INTO statement as shown in the following sample script: &lt;?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_links (id, url) VALUES (" . " 101, 'dev.fyicenter.com')"; if (...
2016-10-20, 292👍, 0💬

Quoting Date and Time Values in PHP
How To Quote Date and Time Values in SQL Statements in PHP? If you want to provide date and time values in a SQL statement, you should write them in the format of "yyyy-mm-dd hh:mm:ss", and quoted with single quotes ('). The tutorial exercise below shows you two INSERT statements. The first one uses...
2016-10-19, 561👍, 0💬

Quoting Text Values in PHP
How To Quote Text Values in SQL Statements in PHP? Text values in SQL statements should be quoted with single quotes ('). If the text value contains a single quote ('), it should be protected by replacing it with two single quotes (''). In SQL language syntax, two single quotes represents one single...
2016-10-19, 299👍, 0💬

Updating Existing Rows in PHP
How To Update Existing Rows in a Table in PHP? Updating existing rows in a table requires to run the UPDATE statement with a WHERE clause to identify the row. The following sample script updates one row with two new values: &lt;?php include "mysql_connection.php"; $sql = "UPDATE fyi_links SET no...
2016-10-19, 290👍, 0💬

<< < 11 12 13 14 15 16 17 18 19 > >>   Sort: Rank