<?php
//Database Connection
$connection = mysql_connect("localhost", "root","mysql");
if(!$connection){
die("Database connection failed: ". mysql_error());
}
//Select a database to use
$db_select = mysql_select_db("school",$connection);
if(!$db_select){
die("Database connection failed: ". mysql_error());
}
//Database query
$result = mysql_query("DELETE FROM tblstudent WHERE id=$id AND course='$course'", $connection);
if(!$result){
die("Database connection failed: ". mysql_error());
}
// Use returned data
//while ($row = mysql_fetch_array($result)){
//}
mysql_close($connection);
?>
weajane01 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.