Results 1 to 8 of 8

Thread: Querying MySQL [Resolved]

Threaded View

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Querying MySQL [Resolved]

    I though I knew a bit about querying MySQl, but the PHP syntax is killing me here...

    I want to get the results from a table called arrangement in a database that is called klub_info. I only want to get the fields that has an O in the aBy field. But I can't get the syntax to work at all. I have no clue here...I am stil reading in my stupid book here. But it's not a very good book.

    this is what I more or less wrote straight from my book:

    Code:
    $sterm = 'O';
    $stype = 'aBy';
    $resultat = mysql_query("select * from arrangement where ".$stype." like '%".$sterm."%'",$db);
    
    		
    while($arr = mysql_fetch_array($resultat)){
    	echo '$resultat';
    						
    }

    But I can't see where I am choosing the table I want. And I havn't even gotten to the point to use Select to strip down to the fields I actually want from my search result.

    PS: aBy is an Enum field that can only hold 'O', 'B' or 'T'....


    [Edit]Added two lines I forgot to the code[/edit]
    Any ideas?
    Last edited by NoteMe; Apr 13th, 2004 at 06:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width