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

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, 277👍, 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, 267👍, 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, 526👍, 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, 282👍, 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, 277👍, 0💬

Looping through Returning Rows from a Query in PHP
How To Query Tables and Loop through the Returning Rows in PHP? The best way to query tables and loop through the returning rows is to run the SELECT statement with the catch the mysql_query() function, catch the returning object as a result set, and loop through the result with the mysql_fetch_asso...
2016-10-19, 275👍, 0💬

Deleting Existing Rows in PHP
How To Delete Existing Rows in a Table in PHP? If you want to remove a row from a table, you can use the DELETE statement with a WHERE clause to identify the row. The following sample script deletes one row: &lt;?php include "mysql_connection.php"; $sql = "DELETE FROM fyi_links WHERE id = 1102";...
2016-10-19, 260👍, 0💬

Uploading Files to Web Servers in PHP
Where to find tutorials on how to upload files to Web servers in PHP? A collection of tutorials to answer many frequently asked questions on how to upload files to Web servers in PHP. Clear explanations and tutorial exercises are provided on creating file upload HTML tags, setting encoding type on H...
2016-10-17, 312👍, 0💬

Querying Multiple Tables Jointly in PHP
How To Query Multiple Tables Jointly in PHP? If you want to query information stored in multiple tables, you can use the SELECT statement with a WHERE condition to make an inner join. Assuming that you have 3 tables in a forum system: "users" for user profile, "forums" for forums information, and "p...
2016-10-17, 286👍, 0💬

INPUT Tag for File Uploading in PHP
Which HTML Tag Allows Users to Specify a File for Uploading in PHP? To present an input field on your Web page to allow users to specify a local file to upload, you need to use the &lt;INPUT TYPE="FILE" ...&gt; tag inside a &lt;FORM ...&gt; tag. The &lt;INPUT TYPE="FILE" ...&...
2016-10-17, 281👍, 0💬

Setting ID Column as Auto-Incremented in PHP
How To Set the ID Column as Auto-Incremented in PHP? Many tables require an ID column to assign a unique ID number for each row in the table. For example, if you have a table to hold forum member profiles, you need an ID number to identify each member. To allow MySQL server to automatically assign a...
2016-10-17, 271👍, 0💬

FORM Tag for Uploading Files in PHP
How To Write the FORM Tag Correctly for Uploading Files in PHP? When users clicks the submit button, files specified in the &lt;INPUT TYPE=FILE...&gt; will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written &lt;FOR...
2016-10-17, 269👍, 0💬

Retrieving the Last Auto Increment ID in PHP
How To Get the Last ID Assigned by MySQL in PHP? If you use an ID column with AUTO_INCREMENT attribute, you can use the mysql_insert_id() function to get the last ID value assigned by the MySQL server, as shown in the sample script below: &lt;?php include "mysql_connection.php"; $sql = "INSERT I...
2016-10-17, 269👍, 0💬

Processing Uploaded Files in PHP
How To Process Uploaded Files in PHP? How to process the uploaded files? The answer is really depending on your application. For example: You can attached the outgoing emails, if the uploaded files are email attachments. You can move them to user's Web page directory, if the uploaded files are user'...
2016-10-17, 266👍, 0💬

Performing Key Word Search in PHP
How To Perform Key Word Search in Tables in PHP? The simplest way to perform key word search is to use the SELECT statement with a LIKE operator in the WHERE clause. The LIKE operator allows you to match a text field with a keyword pattern specified as '%keyword%', where (%) represents any number of...
2016-10-17, 264👍, 0💬

What Is File Upload in PHP
What Is File Upload in PHP? File upload is Web page function which allows visitor to specify a file on the browser's system and submit it to the Web server. This is a very useful function for many interactive Web sites. Some examples are: Web base email systems for users to send attachments. Forums ...
2016-10-17, 263👍, 0💬

Getting Uploaded File Information in PHP
How To Get the Uploaded File Information in the Receiving Script in PHP? Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array ca...
2016-10-17, 256👍, 0💬

Understanding PHP Arrays and Their Basic Operations
Where to find tutorials in Understanding PHP Arrays and Their Basic Operations? A collection of tutorials to answer many frequently asked questions on basic understanding of PHP arrays. Clear answers are provided with tutorial exercises on declaring and creating arrays, assigning and retrieving arra...
2016-10-15, 303👍, 0💬

Creating an Array in PHP
How To Create an Array in PHP? You can create an array using the array() constructor. When calling array(), you can also initialize the array with pairs of keys and values. Here is a PHP script on how to use array(): &lt;?php print("Empty array:\n"); $emptyArray = array(); print_r($emptyArray); ...
2016-10-15, 267👍, 0💬

What Is an Array in PHP
What Is an Array in PHP? An array in PHP is really an ordered map of pairs of keys and values. Comparing with Perl, an array in PHP is not like a normal array in Perl. An array in PHP is like an associate array in Perl. But an array in PHP can work like a normal array in Perl. Comparing with Java, a...
2016-10-15, 266👍, 0💬

Testing If a Variable Is an Array in PHP
How To Test If a Variable Is an Array in PHP? Testing if a variable is an array is easy. Just use the is_array() function. Here is a PHP script on how to use is_array(): &lt;?php $var = array(0,0,7); print("Test 1: ". is_array($var)."\n"); $var = array(); print("Test 2: ". is_array($var)."\n"); ...
2016-10-15, 265👍, 0💬

Retrieving Values out of an Array in PHP
How To Retrieve Values out of an Array in PHP? You can retrieve values out of arrays using the array element expression $array[$key]. Here is a PHP example script: &lt;?php $languages = array(); $languages["Zero"] = "PHP"; $languages["One"] = "Perl"; $languages["Two"] = "Java"; print("Array with...
2016-10-15, 256👍, 0💬

Filtering Out Empty Files in PHP
Why Do You Need to Filter Out Empty Files in PHP? When you are processing uploaded files, you need to check for empty files, because they could be resulted from a bad upload process but the PHP engine could still give no error. For example, if a user typed a bad file name in the upload field and sub...
2016-10-14, 530👍, 0💬

Detecting File Uploading Errors in PHP
How To Detect File Uploading Errors in PHP? If there was a problem for a file upload request specified by the &lt;INPUT TYPE=FILE NAME=fieldName...&gt; tag, an error code will be available in $_FILES[$fieldName]['error']. Possible error code values are: UPLOAD_ERR_OK (0) - There is no error,...
2016-10-14, 270👍, 0💬

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