Need Programming Assignment Help?

Get Help with Programming Assignment in Java, C/C++, Dot Net, PHP, Database and UML Diagrams

All posts in PHP Programming

Creating New Database in PHP

New Database in PHP <?php $link = mysql_pconnect(“localhost”, “mysql_user”, “mysql_password”) or die(“Could not connect: ” . mysql_error()); if (mysql_create_db(“my_db”)) { print (“Database created successfully\n”); } else { printf (“Error creating database: %s\n”, mysql_error()); } ?>

Basic MySQL Example in PHP

MySQL Example in PHP Basic MySQL Example Program in PHP – Its is the simple programming example for creating MySQL program in PHP Programming. <?php /* Connecting, selecting database */ $link = mysql_connect(“mysql_host”, “mysql_user”, “mysql_password”) or die(“Could not connect”); print “Connected successfully”; mysql_select_db(“my_database”) or die(“Could not select database”); /* Performing . . . Read more

Trim Function in PHP

Trim Function in PHP The trim() function removes whitespace and other predefined characters from both sides of a string. Related functions: ltrim() – Removes whitespace or other predefined characters from the left side of a string. rtrim() – Removes whitespace or other predefined characters from the right side of a . . . Read more

Sorting Strings in PHP

Sorting Strings in PHP Sorting Strings in PHP Programming – This section of PHP Programming explains Sorting Strings in PHP Programming. <?php $arr1 = $arr2 = array(“img12.png”,”img10.png”,”img2.png”,”img1.png”); echo “Standard string comparison\n”; usort($arr1,”strcmp”); print_r($arr1); echo “\nNatural order string comparison\n”; usort($arr2,”strnatcmp”); print_r($arr2); ?>

Parsing Query String

Parsing a Query String Parsing Query String – This simple PHP Progam explains Parsing  Query string. The parse_str($str) function parses a query string into variables. <?php $str = “first=value&arr[]=foo bar&arr[]=baz”; parse_str($str); echo $first; // value echo $arr[0]; // foo bar echo $arr[1]; // baz parse_str($str, $output); echo $output[‘first’]; // value . . . Read more