Jump to content

aldrin151

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aldrin151's Achievements

Member

Member (2/5)

0

Reputation

  1. Solved my own problem... SELECT DISTINCT listings.id, listings.prop_type FROM listings WHERE (FIND_IN_SET( 'commercial', `listings`.`prop_type`))
  2. Hello everyone…I stumbled on a little problem trying to retrieve records using the where field IN() . I have a table called listings and a field within the table called prop_type. The field type is set to SET and the values are ‘commercial’,’residential’ etc so when looking at it in the structure view of the table in phpmyadmin the type looks like set('commercial', 'residential')… I’m trying to query this table with a search form that uses two or more check boxes <input type="checkbox" value="commercial" name=" prop_type []"><input type="checkbox" value=" residential " name=" prop_type []"> foreach ($_POST['prop_type'] as $pt) { $in1 .= "'" . $pt . "',"; } $in1 = substr($in1,0,strlen($in1)-1); // the we strip the final comma. $query = "SELECT * FROM listings WHERE prop_type IN (" . $in1 . "); $result = mysql_query($query); I have two records stored. One record has both commercial and residential and the other just has commercial. When I query from the search form by checking the commercial checkbox only, I retrieve the record which has just commercial. SQL Print out by echo: SELECT * FROM listings WHERE prop_type IN (‘commercial’) Is there another way to do this or why this is? Thanks
  3. Listen Corbin...I got you wrong and I guess you misunderstood me also...I really appreciate the help...seriously...I was having a bad day and got all screwed up. I apologize ... I really like learning from people who know more...also we're on this forum I guess to get support and help one another, "two heads are better than one" especially in stuff like this where you can get so involved in things and have a hard time solving simplest of problems. After all this going back and forth non sense, due to my fault...I learned something...that solution you gave me worked...Thanks very much...your a cool guy.
  4. No it wasn't the id thing since there are more sub_titles with that id...but thanks for the info...more like it...I didn't tell you to go learn PHP. You got it wrong...You should learn not to be arrogant when messaging back people on this forum...
  5. Why the hell would you answer back to this post and mock someone to learn PHP & Mysql first when you don't know the answer or help...? Instead of stating next_record() to display the next record in the row, I wanted to see if I could leave it out and write something else to replace mysql_fetch_array($Results)...I'm using a new PHP code generator for your info DUDE!
  6. Hi, sound kind of stupid but how do you display all records, instead of just one...my code displays the next_record only $db = new clsDBConnection1; $SQL = "SELECT sub_title FROM sub_cats where main_id='1'"; $db->query($SQL); $Results = $db->next_record(); echo $db->f("sub_title"); $db->close();
  7. Hello, I wanted to see what would be the best way if I was to retrieve values from one field. For example if I have stored Blue, Red, Green, Yellow as it would exactly be stored in the field, and then later be retrieved by search ... example search this field for Blue Green Yellow and sort DESC by the higher number of matches for records... Any suggestions or clues would be greatly appreciate it... thanks
  8. Thanks R0bb0b, I always refer to that site...I'm checking it out...
  9. Hey guys, I really appreciate your help...good to know we got a lot of members on this site willing to help...thanks again
  10. Thanks...so the correct term for this function if I were to search for it would be "active search" ?
  11. Hello, does anyone know what I would search for or know how to create a textbox to retrieve data from a mysql table? For example a user has the option to either enter their own writing in the text box or the textbox drop downs a list of values pulled from the table. Another example would be if you're on yahoo or google search box and a suggestion of what people have searched for displays. Thanks.
  12. One more question, displaying the url on the address bar as http://<domainname>.tld/Computer_Services/search, would it also apply in someone doing a right click on the page and viewing the page address? Thanks
  13. Thank you very much for the info, I'm gonna look into it and see...
×
×
  • 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.