Ad block is installed and active. Please support us by disabling it.
HomeSaturday, October 21, 2017, 10:36:03
0

php Array

Tuesday, February 10, 15, 10:35:58, 3 Yaers Ago Via wain, Hits: 3406
These functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.
Example:
Code:
<?php
$acvalue = array(1 => 'value1',2 => 'value2',3 => 'value3');
echo"<pre>";
print_r ($acvalue);
echo"</pre>";
?>


http://phpform.net/images/array_screen.png

Mysql Example:
Code:
CREATE TABLE `test` (
`id` int(11) NOT NULL auto_increment,
`text0` text collate utf8_unicode_ci,
`text1` text collate utf8_unicode_ci,
`text2` text collate utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

INSERT INTO `test` VALUES (1, 'text1', 'text1a', 'text11a');
INSERT INTO `test` VALUES (2, 'text2', 'text2b', 'text22b');
INSERT INTO `test` VALUES (3, 'text3', 'text3c', 'text33c');


Code:
<?php
$dbhost = 'localhost';
$dbusername = 'root';
$dbpassword = '';
$dbname = 'testbase';
$link=mysql_connect($dbhost, $dbusername);
if(!$link) :
die('Could not connect: ' . mysql_error());
endif;
$db=mysql_select_db($dbname, $link);
if(!$db) :
die ('Cant connect to database : ' . mysql_error());
endif;
?>


Code:
<?php
include ('config.php');
$result = mysql_query("SELECT * FROM `test`")
or die(mysql_error());
while ($aclrow = mysql_fetch_assoc($result))
{
$aclvalue[0] = $aclrow;
echo"<pre>";
print_r($aclvalue[0]);
echo"</pre>";
}
?>


http://phpform.net/images/array_screen2.png

Sign In

Sponsor

Related

MySQL to RSS

Publishing MySQL data in RSS

PHP Links Script 1.1.

This script allows you to manage your links using a MySQL database. It features easy install, user submission, and an admin panel to add, edit and remove categories and links. The script is easy to customize to suit your needs.

Link Base L.1.1.

This script allows you to manage your links using a MySQL database. It features easy install, user submission, and an admin panel to add, edit and remove categories and links. The script is easy to customize to suit your needs.

Contact Us 2.0. :: PHP Form

Version 2.0. - A contact us form with email and form field validation. It allows your visitors to send you an email directly from your website.

How to insert new line (IP Address) with fwrite

How to insert new line (IP Address) with fwrite, Get IP address and write to file.

PHP Form Validation

PHP form validation :: PHP tutorial, requirement(s): PHP Server

Show / Hide Div with CSS

CSS Display and Visibility:The visibility property specifies whether or not an element is visible.

Creating a CAPTCHA with PHP with imagecreate

This tutorial will show you how to create a form with Captcha, Requirement(s): PHP Server, GD Graphics Library

Captcha V2 - Free PHP Script

PHP Captcha protection image Version 2, - Requirement(s): PHP Server, GD Library

Email to Friend - PHP Script

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.