LAMP_TRAINING_SESSION_8
Upcoming SlideShare
Loading in...5
×
 

LAMP_TRAINING_SESSION_8

on

  • 884 views

Presentaions of LAMP Training Conducted by T.Umapathi Anand and R.Kasturi from Southern Telecom Region, BSNL at RTTC Trivandrum.

Presentaions of LAMP Training Conducted by T.Umapathi Anand and R.Kasturi from Southern Telecom Region, BSNL at RTTC Trivandrum.

Statistics

Views

Total Views
884
Views on SlideShare
884
Embed Views
0

Actions

Likes
0
Downloads
17
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

LAMP_TRAINING_SESSION_8 LAMP_TRAINING_SESSION_8 Presentation Transcript

  • Connecting to MySQL <?php $con = mysql_connect(‘localhost’,’lampusr’,’lamppwd’); If($con) { echo “Connected”; }else{ echo “Could not connect to MySQL”; exit(); } ?>
  • Closing MySQL <?php $con = mysql_connect(‘localhost’,’lampusr’,’lamppwd’); If($con) { echo “Connected”; // do some work with mysql mysql_close($con); }else{ echo “Could not connect to MySQL”; exit(); } ?>
  • Executing Query - Creation <?php mysql_query(“create database if not exists ‘abc’”,$con); mysql_use_db(‘abc’); mysql_query(“create table if not exists trainee(name varchar(30) primary key, score int(3))engine=myisam”); ?>
  • Executing Query - Insert <?php $q = “((‘Trainee1’, 20), (‘Trainee2’,’40’), (‘Trainee3, 60))”; mysql_query(“insert into abc.trainee values $q”); echo mysql_error(); ?> name score trainee1 20 trainee2 40 tainee3 60