Jump to content

JTapp

Members
  • Posts

    251
  • Joined

  • Last visited

Everything posted by JTapp

  1. I'm trying to search through two tables with a common ID field. I'm trying to return results from a search.html page using $metode LIKE '%$search% but I can't seem to get the code right. It seems like I'm really close.. can somebody please take a look? Here is my latest code - I've changed my tablenames and fieldnames to make it easier for you to read: $query = mysql_query("SELECT table1.field1, table1.field2, table2.field1, table2.field2 FROM table1, table2 WHERE $metode LIKE '%$search%' LIMIT 0, 50"); while ($row = @mysql_fetch_array($query)) { $variable1=$row["field1"]; $variable2=$row["field2"]; $variable3=$row["field3"]; $variable4=$row["field4"]; //table layout for results print ("<tr>"); echo "<td class=\"td_id\"><strong>$variable1</strong></td>\n"; print ("<td>$variable1</td>"); print ("<td>$variable2</td>"); print ("<td>$variable3</td>"); print ("<td>$variable4</td>"); print ("</tr>"); }
×
×
  • 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.