Jump to content

gigido

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gigido's Achievements

Member

Member (2/5)

0

Reputation

  1. ah.. that makes sence... thanks!
  2. hi, i have a mysql query that returns a list of names . I want to make it so when you click the name, it brings you to another page and displays the reset of the information stored in the database for that name. Just wanted to know the process of making that happen.
  3. perfect, thanks for the insight.... very helpful.
  4. hi, i have this statement ("SELECT * FROM `listings` WHERE year= \"".$_POST['year']."\" or type =\"".$_POST['type']."\" and title LIKE \"". $_POST['title'] ."\"") now these values are populated by an html form with 2 drop down menus and one title text search field. the issue is getting the results to search for all the entries when the drop down isnt selected. As of now its been searching for value ="" I basicaly am trying to give the user 3 ways of searching, and the ability to use all 3 options at once to get more refined results. Im not sure if the "OR" is the right thing to be using in this situation. thanks.
  5. Thanks all for the help.. problem solved...
  6. im starting to think its the way im handling and displaying my results... when i remove the while ($row = mysql_fetch_array($sql)) { $title2 = $row['title'] ; echo "<b>title:</b> $title2 <br>"; } or only have my retrieval statement the errors go away.
  7. arrr... nope... really doesnt make much sence why it wouldnt. but same error .
  8. hmmm negative.. this comes up with that same error.
  9. un certain, but will give it a try, however just to be sure i took out searching for title and using LIKE until i can isolate the cause. But with taking out the title line, i still get that same error.
  10. makes perfect sence. thank you for clarifying. umm... still getting an error of "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource" heres what the code is: $result = mysql_query ("SELECT * FROM `listings` WHERE number= ".$_POST['number']." or state =".$_POST['state']." and title LIKE ". $_POST['title'] .""); while ($row = mysql_fetch_array($result)) { $title = $row['title'] ; echo "<center>title: <b>".$row['title']."</b></center>"; } also changed it to just $row = mysql_fetch_array($result)) as opposed to the while statement, and also had an error.
  11. there are no null values in my database, but are you saying when i us the "or" it will ignore any fields that are left blank? cause if it was "select from the table where title= 1 or number = 2"... I would only want the value returned that would have the same number and title.... not values that have 1 or the other.
  12. hi, i dont see a need for java or validation. its a drop down menu, so its okay to have an empty value <select name="state" id="state"> <option value=""></option> <option value="ma">ma</option> <option value="ca">nh</option> <option value="nh">nh</option> <option value="vt">vt</option> </select> number: <select name="number" id="number"> <option value="*"></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <input name="title" type="text" id="title" /> <input name="Search" type="submit" id="Search" value="search" /> </div> </label> </form> the php $result = mysql_query ("SELECT * FROM listings WHERE state= ".$_POST['state']." and number =".$_POST['number]." and title = ".$_POST['title']."" ); so you have option to select a state, number from a drop down menu, as well as search via the text search .. so if you just want to search by state you select state from the drop down menu and the other values remain empty. so for my query to search the database i get an error if the values are empty. so how do a make it so when the drop down menu is empty that its not searching for an empty value in my database.
  13. hi i have 3 drop down fields, when a drop down is left blank (which i have given no value, so "") i seem to get an error on my search results. how do i make it so when there is no value in one of the fields that all values are retrieved for that particular drop down menu, so that its not searching for "" .
  14. Hi i have a page where i want 3 links for instance. option 1, option 2, option 3 . Whats the best way to have it so when you click option 1 , that a particuar MYSQL search occurs displaying certain information on the page, and when option 2 is clicked it would display something else , and so on.... I take it i need to attach a hyperlink to the text? if thats being the case how abouts does that work, i'm unfamiliar with making a variable or mysql link like so. thanks!
×
×
  • 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.