Jump to content

stone.cold.steve.austin

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stone.cold.steve.austin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, Suppse I have a column in my database called Description with the the following rows in the coumn: I am an artist I am an art teacher and i want to check to see if any of the rows in that column contain the word "art" - art as its own word, not as part of a word. so i use this peiece of code to find the records that have art and print them to the page: $query = "select Description from TableName where (Description like '%art%')"; while ($row = @mysql_fetch_array($query , MYSQL_ASSOC)) {   print $row{'Description'} . "<br>"; } however the above code with the like statement returns both the records, where as I only want to return the second record that has "art" - as its a match for a whole word in that row, not as part of a word (ie. the like statement sees "art" as a match with "artist", but i dont want it too. am i making sense? if so, can the above code be modified too do what i want. thanks Richard
  2. alright cheers for that, i was hoping there was a way to do it without the loop as the loop is very slow but oh well must be done :) cheers.
  3. sorry the page didnt display and mutiple messages displayed for my post
  4. Thanks for the help. but it doesn't seem to be working, the principle is correct but this bit is wrong i think: $rsfeed = mysql_query("select Title from Abstracts where (ID = '12')); $thearray = mysql_fetch_row($rsfeed); the mysql_fetch_row only returns 1 row, ie. 1 title, yet there is actually multiple titles for ID=12, i need an array of these titles, i have tried using instead: $thearray = mysql_fetch_array($rsfeed); but that doesn't work, what command should i be using to get my resultset into an array? thanks, richard
  5. Thanks for the help. but it doesn't seem to be working, the principle is correct but this bit is wrong i think: $rsfeed = mysql_query("select Title from Abstracts where (ID = '12')); $thearray = mysql_fetch_row($rsfeed); the mysql_fetch_row only returns 1 row, ie. 1 title, yet there is actually multiple titles for ID=12, i need an array of these titles, i have tried using instead: $thearray = mysql_fetch_array($rsfeed); but that doesn't work, what command should i be using to get my resultset into an array? thanks, richard
  6. Thanks for the help. but it doesn't seem to be working, the principle is correct but this bit is wrong i think: $rsfeed = mysql_query("select Title from Abstracts where (ID = '12')); $thearray = mysql_fetch_row($rsfeed); the mysql_fetch_row only returns 1 row, ie. 1 title, yet there is actually multiple titles for ID=12, i need an array of these titles, i have tried using instead: $thearray = mysql_fetch_array($rsfeed); but that doesn't work, what command should i be using to get my resultset into an array? thanks, richard
  7. Hi, I have the following peice of code which pulls data from a database: $rsfeed = mysql_query("select Title from Abstracts where (ID = '12')); $thearray = mysql_fetch_row($rsfeed); I can print the title using: print $thearray[0]; but theactual resultset is more then 1 row, and what i need to do is print the first row ($thearray[0]) and the last row, how do i modify the above code to achieve that? thanks, Richard
×
×
  • 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.