In this code I want to query a table called "zipcodes". I want to first check to see if the zip code entered is a valid zip code. Then if it is a valid zip code I want to retrieve that zip code with the matching longitude, latitude, city, & state.
Then after retrieving them I want to place them into another table called "Users". Once in Users table I want to be able to pull the values that are assigned to them to echo in various places on my website.
<?php
$query = mysqli_query($con, "SELECT * FROM zipcodes WHERE ZIP='".$user_zip."'");
if(mysqli_num_rows($query) > 0){
echo "Please Reenter A Valid Zip Code";
{
}elseif(mysqli_num_rows($query) > 1){
mysqli
// Need to put next line of code in users db
}elseif (mysqli_num_rows($query) > 1($con, "INSERT INTO ")){
// retrieve from the database the city and state
}elseif ($user_zip == true( $query = mysqli_query($con, "SELECT * FROM zipcodes ZIP,Latitude,Longitude,City,State WHERE ZIP='".$zip.", Latitude='".$latitude"', Longitude='".$longitude"', City='".$local"', State='".$country"', "'")) {
{
}
?>