I have a database with following fields: jobtitle company city state country source date snippet url now i want to display the following results from my database: country=US (no problem here) sate=OK (no problem here) snippet= (must contain the word 'accounting') --> this is where i have probs. I have this so far, but i can´t seem to only get results which contain the word accounting in snippet. $query="SELECT * FROM sri_xmlphp WHERE country='US' AND state='OK' ORDER BY id DESC limit $eu, $limit "; PHP: Anyone has an idea? Thx in advance Smetten
thx for the help krakjoe it worked but now i'm faced with another problem. It displays the correct results now, but my pagination is wrong. i have this code for the pagination query: /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2="SELECT * FROM `sri_xmlphp` WHERE `state` = 'OK'"; $result2=mysql_query($query2); echo mysql_error(); $nume=mysql_num_rows($result2); echo "<center><i><font size=2>We have found ".$nume." jobs of your choice</i></font size></center><br><br>"; /////// The variable nume above will store the total number of records in the table//// PHP: so i want: state=OK - this is ok already and snippet=(must contain the word 'accounting') -->what should i add to the code above for this to work? Greetz Smetten
if( ( $result = mysql_query( "SELECT * FROM sri_xmlphp WHERE state = 'OK' AND snippet LIKE '%accounting%'" ) ) ) { if( ( $nume = mysql_num_rows( $result ) ) ) { printf( "<center><i><font size=2>We have found no %d jobs terms</i></font size></center><br><br>", $nume ); /** execution continues from here **/ } else echo "<center><i><font size=2>We have found no jobs matching terms</i></font size></center><br><br>"; } else printf( "<center><i><font size=2 style=\"color:red;\">%s</i></font size></center><br><br>", mysql_error( ) ); PHP: