Create Table in MySql using PHP January 6, 2013 Create table in MySql using PHP: <?php $con = mysql_connect(“localhost”,”root”,”root”); mysql_select_db(“db_name”, $con); $sql = “CREATE TABLE Persons ( FirstName varchar(15), LastName varchar(15), Age int… Continue Reading
Deleting Database in MySql using PHP January 6, 2013 Deleting Database in MySql using PHP: <? $sql = “DROP DATABASE testDB2”; $connection = @mysql_connect(“localhost”,”rot”,”root”)or die(mysql_error()); $result = @mysql_query($sql,$connection) or die(mysql_error()); if ($result) {… Continue Reading
Create New Database in My Sql using PHP January 6, 2013 Create New Database in My Sql using PHP: <?php $sql = “CREATE database sexybabe_db”; $connection = mysql_connect(“localhost”,”root”,”root”); $query = mysql_query ($sql, $connection) or die(mysql_error());… Continue Reading
List Database and Tables from MySql in PHP January 6, 2013 List Database and tables in PHP: <?php $connection = @mysql_connect(“localhost”,”root”,”root”) or die(mysql_error()); $dbs = @mysql_list_dbs($connection) or die(mysql_error()); $db_list = “<ul>”; $i = 0; while… Continue Reading
Establishing a Connection to MySql in PHP January 6, 2013 Establishing a Connection to MySql using PHP: <? $connection = @mysql_connect(“localhost”, “root”, “root”) or die(mysql_error()); if($connection) { echo “Connection success!”; } ?> Continue Reading
Uploading Files to Your Web Site January 6, 2013 Creating the Form: Start out by creating a one-field form. You can create a form to upload as many files as you like after… Continue Reading
Delete Files in PHP January 6, 2013 Deleting Files:Be very careful when using the unlink() function because once you’ve deleted a file, it’s gone for good. Example:<?php$new_file = “e:/ashu.txt”;$success = unlink($new_file)… Continue Reading
Rename Files in PHP January 6, 2013 Renaming Files:Like the copy() function, the rename() function just needs to know the original filename and a new filename. In this case, you’re just… Continue Reading
Copying Files in PHP January 6, 2013 Copying Files in PHP: The copy() function is very simple: It needs to know the original filename and a new filename, and that’s all there… Continue Reading
Read Data from File with Proper New Line January 6, 2013 Read Data from File with proper New Line : That’s definitely the string written to the file, but what happened to that line break?… Continue Reading