connect9.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully");

    mysql_select_db("donor");

$idno='44444';

$result = mysql_query("SELECT * from donor where idno = '$idno'")

    or die("Invalid query: " . mysql_error());

$row = mysql_fetch_array($result);

   echo ("<br> ID = ". $row[0] . "<br> NAME =  " . $row["name"] . "<br>");

   echo("CITY = " . $row["city"] . "<br> STATE = " . $row["state"] . "<br>");

?>

</body>

</html>

I tried this with different idnos which is why you have connect9a etc.

 

connectmain1.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully");

    mysql_select_db("donor");

$sql = "INSERT INTO donor values ('44444', 'Al Richards', '111 South St', 'Braintree', 'MA',

                     '02184','2002-10-10',300, 'John Smith')";

$result= mysql_query($sql,$link) or die(mysql_error());

echo $result;

?>

</body>

</html>

 

connectmain1b.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully");

    mysql_select_db("donor");

$sql = "INSERT INTO donor values ('45654', 'John Doe', '123 Elm St', 'Swansea', 'MA', '02345',

                   '2001-10-12',300, 'John Smith')";

if (mysql_query($sql,$link))

   {

    echo "<b />Record added";

   }

else

   {

    echo "<br />Must have been a duplicate";

   }

?>

</body></html>

connectmain2.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully");

    mysql_select_db("donor");

$getidno='45654';

$sql = "DELETE FROM donor WHERE idno = '$getidno'";

if (mysql_query($sql,$link))

   {

    echo " record deleted";

   }

else

   {

    echo " record not found";

   }

?>

</body>

</html>

 

connectmain3.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully ");

    mysql_select_db("donor");

$getidno = '33333';

$sql = "UPDATE donor SET stadr = '111 North St' WHERE idno = '$getidno'";

$result= mysql_query($sql,$link) or die(mysql_error());

echo $result;

?>

</body>

</html>

 

deletedonor.html

<html>

<head>

<title>Insert</title>

</head>

<body>

<form action="deletedonor.php" method="POST">

Enter the identification number for the record you want to delete.<br><br>

IDNO:

<input type="text" name="idno">

<input type="submit" value="Click">

</form>

</body>

</html>

 

deletedonor.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully ");

    mysql_select_db("donor");

$idno;

$sql = "DELETE FROM donor WHERE idno = '$idno'";

$result= mysql_query($sql,$link) or die(mysql_error());

echo $result;

?>

</body>

</html>

 

insertdonor.html

<html>

<head>

<title>Insert</title>

</head>

<body>

<form action="insertdonor.php" method="post">

IDNO:

<input type="text" name="inidno">

<br>NAME:

<input type="text" name="inname">

<br>STREET ADDRESS:

<input type="text" name="instadr">

<br>CITY:

<input type="text" name="incity">

<br>STATE:

<input type="text" name="instate">

<br>ZIP:

<input type="text" name="inzip">

<br>DATE FIRST CONTRIBUTED:

<input type="text" name="indatefst">

<br>YEAR GOAL:

<input type="text" name="inyrgoal">

<br>CONTACT:

<input type="text" name="incontact">

<br>

<input type="submit" value="Click">

</form>

</body>

</html>

 

insertdonor.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully");

    mysql_select_db("donor");

$idno=$_POST[inidno];

$name=$_POST[inname];

$stadr=$_POST[instadr];

$city=$_POST[incity];

$state=$_POST[instate];

$zip=$_POST[inzip];

$datefst=$_POST[indatefst];

$yrgoal=$_POST[inyrgoal];

$contact=$_POST[incontact];

$sql = "INSERT INTO donor values ('$idno', '$name', '$stadr', '$city', '$state', '$zip', '$datefst', '$yrgoal', '$contact')";

$result= mysql_query($sql,$link) or die(mysql_error());

echo $result;

?>

</body>

</html>

 

connectdonorbasic.php

<html>

<head><title>PHP and MySQL</title></head>

<body>

<h1>Test of PHP</h1>

<?php

    $link = mysql_connect("localhost", "pgrocer", "thePassword", "donor")

        or die("Could not connect: " . mysql_error());

    print ("Connected successfully");

    mysql_select_db("donor");

$idno;

$name;

$stadr;

$city;

$state;

$zip;

$datefst;

$yrgoal;

$contact;

$sql = "INSERT INTO donor values ('$idno', '$name', '$stadr', '$city', '$state', '$zip', '$datefst', '$yrgoal', '$contact')";

$result= mysql_query($sql,$link) or die(mysql_error());

echo $result;

?>

</body>

</html>