exercise 1
connect to apache server root and the password, then create a database and to create table.
use this php code
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE alex",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
// Create table
mysql_select_db("alex", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// Execute query
mysql_query($sql,$con);
mysql_close($con);
?>
Blogger templates
Blogger news
Blogroll
Archives
-
▼
2012
(231)
-
▼
May
(21)
- opens a directory with opendir() in php
- Generate random password
- About me and PHP
- MySQL Commands
- Form Validator
- file write in php
- Connecting to server, create database and creating...
- পিএইচপি অ্যারে
- How to start PHP?
- Drag and drop to order list elements with Scriptac...
- Create Online Shop using Paypal, PHP and Dreamweaver
- Step by step PHP video tutorials from start to fin...
- Membuat Script PHP untuk Kompresi File ZIP
- Control Structures in PHP: FOR
- Joomla-v-15-Configure-and-troubleshoot-SEF-URLs
- Registration Form
- Searh script
- Installing of Webserver : Apache 2.0.53
- What is PHP
- Drag and drop to order list elements with Scriptac...
- How to hack into a facebook account
-
▼
May
(21)