Jump to content

hansman

Members
  • Posts

    100
  • Joined

  • Last visited

    Never

Everything posted by hansman

  1. Ok, understood, I was reading up, and i think i forgot to mention something. I want to be able to have more then one company per zip code, so would i have to add another table on the db and add combonations of zip codes and ID numbers?
  2. also what does the "z" by itself mean in that query
  3. ok so i have my Zip Codes ----------- Fields: ----------- Zip Code State zip_id(all unique) Companies ----------- Fields: ----------- Name Zip Codes PhoneNumber comp_id(unique) ZipsToCompany ------------ id(unique) comp_id zip_id My zip codes will be placed in the "Zip Codes" Field in Companies, separated by commas. I then go into my ZipsToCompany and type the comp_id with zip_id in. I will then run the query that you provided(with my table name changes) Is this correct?
  4. ok, i am understanding this more now. So when a user searches for the Zip Code: 12345 $zip = 12345 Select * From Zips WHERE ahh i cant figure it out.
  5. so each zipcode would be placed it their own fields, in the zip_to_company table? Yeah i am a novice, im just trying to figure this out, and all my problems will be solved trying to figure this out.
  6. i dont understand how i would run the php to find the zip code in the field
  7. hansman

    Zip Codes

    I have a Table filled with zip codes. I have another table that i wish to put companies in. In this table there is a field for zip codes. I would like to place several zip codes in this box. I then would like the company profile to come up when i search for one of the zip codes. How can i go upon doing this? Can anyone help?
  8. I have a Table filled with zip codes. I have another table that i wish to put companies in. In this table there is a field for zip codes. I would like to place several zip codes in this box. I then would like the company profile to come up when i search for one of the zip codes. I dont know how I would use explode(). Or if i should be using another method. Can anyone help?
  9. ok, I think i will be purchasing this, what would be the best way to have someone search their zip code and show company's in nearby zips?
  10. take for example http://www.propursuit.com/pestcontrol/ it looks like this guy broke up the zip codes into zones, how could i do that?
  11. I am just looking for an easy way for people to find companies in their areas using zip codes, should i not use zip codes? Also, does any one have a sql file with every city state zip in the country(USA)
  12. zip codes are near each other with the first 4 numbers? do you know of any free GPS long lat scripts?
  13. Hello, I searched google and the forums, but i cannt seem to find a way to use php with zip codes in my database to use zip codes near by. For example if i had a store located in the "12345" zip code, and some once searched "12349" and that was the town next to it, it would pop up. How can i go upon doing this. Also, is there a SQL text document somewhere that has a list of every US zip code with city and state?
  14. for some wacky reason im only getting results from number query 3
  15. Hello all, I have about 5 tables in a database that stroe pictures. I want to have one page where all the pictures come out. This is my code. $query = "SELECT * FROM Wood_Destroying_Insects"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<img src='saveimg.php?id=".$row['id']."'/>"; ideas?
  16. session_start(); // start up your PHP session! $_SESSION['id'] = $_GET['id']; $_SESSION['table'] = $table; if(isset($_GET['id'])) { $id = $_GET['id']; mysql_connect("xxxxxxxxxx", "xxxxxxxxxxx", "xxxxxxxxxx"); mysql_select_db("xxxxxxxxxxxxxx") or die( "Unable to select database"); $query = "SELECT * FROM $table WHERE id='$id'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo $row['Name']; ?> </title> <link href="css.css" rel="stylesheet" type="text/css"> </head> <body> <div class="all"> <span class="data"> <?php include("header.php"); ?> <div class="center"> <div class="pestcat"><? echo $row['Name']; ?></div> <div class="pic"><? echo "<img src='saveimg.php?id=".$id."'/>" ?></div> <span class="desc"><? echo $row['sum']; ?></span><br /><br /> <div class="site"><a href="pestdesc.php?id=<? echo $id; ?>?table=<? echo $table; ?>?cat=Habitat">Habitat</a></div><div class="site"></div><div class="site">Color</div><div class="site">Tips For Control</div><div class="site"></div> </div> <? } include("footer.php");?> I want to have links for Habitat, Color, and the will go to pestdesc.php and display what ever you click on, and then show the menu again.
  17. Hello, I have my mysql data base with a user profile with name, description etc in it. On the profile page i want to display the persons name, then have a link fro description etc. How would i go upon putting this in so it will be able to be used across the site?
  18. <form action="insertadnow.php" method="post"> <p align="center">Company Name:<br /> <input name="name" type="text" /> <br /> <p align="center">State:<br /> <select name="state"> <option>AK</option> <option>AL</option> <option>AR</option> <option>AZ</option> <option>CA</option> <option>CO</option> <option>CT</option> <option>DE</option> <option>FL</option> <option>GA</option> <option>HI</option> <option>IA</option> <option>ID</option> <option>IL</option> <option>IN</option> <option>KS</option> <option>KY</option> <option>LA</option> <option>MA</option> <option>MD</option> <option>ME</option> <option>MI</option> <option>MN</option> <option>MO</option> <option>MS</option> <option>MT</option> <option>NC</option> <option>ND</option> <option>NE</option> <option>NH</option> <option>NJ</option> <option>NM</option> <option>NV</option> <option>NY</option> <option>OH</option> <option>OK</option> <option>OR</option> <option>PA</option> <option>RI</option> <option>SC</option> <option>SD</option> <option>TN</option> <option>TX</option> <option>UT</option> <option>VA</option> <option>WA</option> <option>WI</option> <option>WV</option> <option>WY</option> </select> <p align="center">County:<br /> <input name="county[]" type="text" id="county[]" /> <p align="center">Contact Email: <br /> <input name="email" type="text" /> <p align="center">Username Desired: <input name="user" type="text" id="user" /> <p align="center">Password Desired: <input name="password" type="text" id="password" /> <p align="center"> <label> <input type="submit" name="submit" id="submit" value="Submit" /> </label> </form>
  19. well it is a form that i will type in the county manually, and then the page will display what ever counties have been typed in
  20. Does this make sense? The form value is county[] i tired it out and the valuse of county is set to "Array" $state = $_SESSION['state']; $name=$_POST['name']; $email=$_POST['email']; $state=$_POST['state']; $user=$_POST['user']; if (isset($insNumRows)) { for ($I=1; $I<=$insNumRows; $I++) { if (isset($_POST["county$I"]) && is_array($_POST["county$I"])) { $_POST["county$I"] = implode(",", $_POST["county$I"]); $HTTP_POST_VARS["county$I"] = $_POST["county$I"]; } } } $password=$_POST['password']; $sql="INSERT INTO ad (name, email, county, state, user, password)VALUES('$name', '$email', '$county', '$state', '$user', '$password')";
  21. so i have the $_POST['county'] comming from the other page, i dont really understand that statments variables, what is the variable going into the dtatabse in the INSERT query
  22. echo "<input type=\"image\" src=\"./images/UI/searchbutton.jpg\" name=\"searchButton\" alt=\"Search\" tabindex="2">";
  23. with pfkdesin wpuld i still create a new table?
  24. Hello, i currently ran into major problems not thiking this scheme out and realized that its not possible, maybe someone could help me I have a table "ad" with fields like, State, County, Name, Username, Passoword, City. i have a drop down menu where a user can select their state, and a list of countys that have been entered for that state is listed. Once they click the county it shows all the names in the county. This works no problem. However, when i insert the "County" with mutiple names such as "county1, county2), i can use the explode() function but i need to insert them into the "County" field and make sure it is not a duplicate. I was thinking i would need to make another table with countys, states and then link it to the table "ad" by "name" any ideas how i can do this?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.