<< < 4 5 6 7 8 9 10 11 > >>   Sort: Date

How To Drop an Existing Database
How To Drop an Existing Database? - MySQL FAQs - PHP Connections and Query Execution If want to drop an existing database from the MySQL server, you can use the DROP DATABASE statement. Here is a good example of dropping an existing database: $con = mysql_connect('localhost:8888' ,'dev', 'iyf'); $sq...
2007-05-10, 4995👍, 0💬

How To Get the Number of Rows Selected or Affected by a SQL Statement
How To Get the Number of Rows Selected or Affected by a SQL Statement? - PHP Script Tips - Working with MySQL Database 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 obj...
2007-04-19, 4991👍, 0💬

What Are the Special Characters You Need to Escape in Double-Quoted Stings
What Are the Special Characters You Need to Escape in Double-Quoted Stings? - PHP Script Tips - Understanding String Literals and Operations There are two special characters you need to escape in a double-quote string: the double quote (") and the back slash (\). Here is a PHP script example of doub...
2007-04-20, 4987👍, 0💬

How To Select an Exiting Database
How To Select an Exiting Database? - PHP Script Tips - Working with MySQL Database 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 W...
2007-04-18, 4987👍, 0💬

How To Receive a Cookie from the Browser
How To Receive a Cookie from the Browser? - PHP Script Tips - Understanding and Managing Cookies If you know that a cookie has been sent to the browser when it was visiting the server previously, you can check the built-in $_COOKIE array, which contains all cookies that were sent by the server previ...
2007-04-25, 4982👍, 0💬

How To Get the Number of Characters in a String
How To Get the Number of Characters in a String? - PHP Script Tips - PHP Built-in Functions for Strings You can use the "strlen()" function to get the number of characters in a string. Here is a PHP script example of strlen(): &lt;?php print(strlen('It\'s Friday!')); ?&gt; This script will p...
2007-04-22, 4982👍, 0💬

How To Support Hidden Form Fields
How To Support Hidden Form Fields? - PHP Script Tips - Processing Web Forms Hidden fields are special fields in a form that are not shown on the Web page. But when the form is submitted, values specified in the hidden fields are also submitted to the Web server. A hidden field can be specified with ...
2007-04-22, 4977👍, 0💬

How To Read the Entire File into a Single String
How To Read the Entire File into a Single String? - PHP Script Tips - Reading and Writing Files If you have a file, and you want to read the entire file into a single string, you can use the file_get_contents() function. It opens the specified file, reads all characters in the file, and returns them...
2007-04-22, 4977👍, 0💬

How To Run a SQL Statement
How To Run a SQL Statement? - MySQL FAQs - PHP Connections and Query Execution 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 FA...
2007-05-10, 4975👍, 0💬

How Variables Are Passed Through Arguments
How Variables Are Passed Through Arguments? - PHP Script Tips - Creating Your Own Functions Like more of other programming languages, variables are passed through arguments by values, not by references. That means when a variable is passed as an argument, a copy of the value will be passed into the ...
2007-04-24, 4971👍, 0💬

How To Open a File for Reading
How To Open a File for Reading? - PHP Script Tips - Reading and Writing Files If you want to open a file and read its contents piece by piece, you can use the fopen($fileName, "r") function. It opens the specified file, and returns a file handle. The second argument "r" tells PHP to open the file fo...
2007-04-22, 4968👍, 0💬

How To Delete Cookie Files on Your Computer
How To Delete Cookie Files on Your Computer? - PHP Script Tips - Understanding and Managing Cookies A simple way to delete cookie files on your computer is to use the function offered by the IE browser. The following tutorial exercise shows you how to delete cookie files created by IE: Open IE (Inte...
2007-04-24, 4963👍, 0💬

How To Get the Uploaded File Information in the Receiving Script
How To Get the Uploaded File Information in the Receiving Script? - PHP Script Tips - Uploading Files to Web Servers 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...
2007-04-19, 4963👍, 0💬

How To Return a Value Back to the Function Caller
How To Return a Value Back to the Function Caller? - PHP Script Tips - Creating Your Own Functions You can return a value to the function caller by using the "return $value" statement. Execution control will be transferred to the caller immediately after the return statement. If there are other stat...
2007-04-24, 4961👍, 0💬

How To Return a Reference from a Function
How To Return a Reference from a Function? - PHP Script Tips - Creating Your Own Functions To return a reference from a function, you need to: Add the reference operator "&" when defining the function. Add the reference operator "&" when invoking the function. Here is a PHP script on how to ...
2007-04-14, 4958👍, 0💬

How To Return an Array from a Function
How To Return an Array from a Function? - PHP Script Tips - Creating Your Own Functions You can return an array variable like a normal variable using the return statement. No special syntax needed. Here is a PHP script on how to return an array from a function: &lt;?php function powerBall() { $a...
2007-04-24, 4957👍, 0💬

How To Pass Arrays By References
How To Pass Arrays By References? - PHP Script Tips - Creating Your Own Functions Like normal variables, you can pass an array by reference into a function by taking a reference of the original array, and passing the reference to the function. Here is a PHP script on how to pass array as reference: ...
2007-04-24, 4957👍, 0💬

Can You Define an Argument as a Reference Type
Can You Define an Argument as a Reference Type? - PHP Script Tips - Creating Your Own Functions You can define an argument as a reference type in the function definition. This will automatically convert the calling arguments into references. Here is a PHP script on how to define an argument as a ref...
2007-04-24, 4957👍, 0💬

How To Create a Table
How To Create a Table? - PHP Script Tips - Working with MySQL Database 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 VARCH...
2007-04-19, 4957👍, 0💬

What Is a Session
What Is a Session? - PHP Script Tips - Understanding and Using Sessions A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a sc...
2007-04-19, 4954👍, 0💬

How To Quote Text Values in SQL Statements
How To Quote Text Values in SQL Statements? - PHP Script Tips - Working with MySQL Database 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...
2007-04-19, 4953👍, 0💬

How To Retrieve the Session ID of the Current Session
How To Retrieve the Session ID of the Current Session? - PHP Script Tips - Understanding and Using Sessions Normally, you don't need to know the session ID of the current session. But if you are interested to know the session ID created by the PHP engine, there are two ways to get it: Calling sessio...
2007-04-18, 4953👍, 0💬

What's Wrong with "while ($c=fgetc($f)) {}"
What's Wrong with "while ($c=fgetc($f)) {}"? - PHP Script Tips - Reading and Writing Files If you are using "while ($c=fgetc($f)) {}" to loop through each character in a file, the loop may end in the middle of the file when there is a "0" character, because PHP treats "0" as Boolean false. To proper...
2007-04-22, 4952👍, 0💬

How To Query Tables and Loop through the Returning Rows
How To Query Tables and Loop through the Returning Rows? - PHP Script Tips - Working with MySQL Database 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 thr...
2007-04-19, 4951👍, 0💬

<< < 4 5 6 7 8 9 10 11 > >>   Sort: Date