#1
  1. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    Is it possible to check the database to see if information being submitted is already present in the database??

    Thank you,

    ------------------
    Hartmann
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    Sure.


    (Naturally, with such an unspecific question, that's the most specific answer you're likely to get.)
  4. #3
  5. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    LOL! You got me there.....

    Can you post some example code on how to make it work?


    ------------------
    Hartmann
  6. #4
  7. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    Anyone??

    ------------------
    Hartmann
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    16
    Rep Power
    0
    Maybe this example will help:


    <?php

    //Check to see if date & time already exist
    $qrydate = "SELECT * from tblAirSchedule WHERE StartDate = '$StartDate' AND EndDate = '$EndDate' ";
    $rstdate = mssql_query($qrydate, $connect);
    $num = mssql_num_rows($rstdate);

    if ( $num != 0 )
    {
    echo "There is a scheduling conflict. Please use your browsers back button and try again";
    //exit;
    } else {

    echo "Your Start Date is: " . $StartDate . "<BR>";
    echo "Your End Date is: " . $EndDate . "<BR><BR>";
    echo "<A HREF="schedules.php3?cookie=$cookie"><I>Back To Schedules</I></A>";

    //define query variables
    $query = "INSERT INTO tblAirSchedule(UID, StartDate, EndDate, Notes) VALUES(";
    $query = $query . ($UID) . ", " . "'" . ($StartDate) . "' " . "," . "'" . ($EndDate) . "' " . "," . "'" . ($Notes) . "'" . ")";

    $result = mssql_query($query, $connect);

    echo "Your schedule has been added";

    }

    ?>
  10. #6
  11. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    Works perfectly Thanks for the help!

    ------------------
    Hartmann

Similar Threads

  1. maysqladmin drop database syntax?
    By Slurm in forum MySQL Help
    Replies: 1
    Last Post: February 17th, 2004, 06:07 AM
  2. 2-dimensial array / mysql_fetch_array database problem
    By paulx82 in forum PHP Development
    Replies: 3
    Last Post: December 27th, 2003, 02:52 AM
  3. creating database & tables using ASP
    By pdxlooie in forum ASP Programming
    Replies: 2
    Last Post: December 26th, 2003, 06:27 PM
  4. distributing database reads among db slaves
    By JunkCookie in forum PHP Development
    Replies: 3
    Last Post: December 17th, 2003, 12:45 PM
  5. Determine end of database
    By patmoses in forum PHP Development
    Replies: 2
    Last Post: December 12th, 2003, 10:59 AM

IMN logo majestic logo threadwatch logo seochat tools logo