Jump to content

manhattes

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by manhattes

  1. Thanks Sen. Very helpful comment. I guess that is a possibility. If that is the case I need to clean the data by going through it a few hundred records at a time. I can apply the index later since it has nothing to do with what I am trying to accomplish. I am creating a brand new dataset that is expedited through the LIKE function since I just need to find a similar phrase/name. I guess preg match might work but i want it to be fuzzier logic. Can you advise what to add to create a new table and delete the records from Calendar as I move through the list? That way if it is a corrupted row I can find it.
  2. There are about 1000 rows in Stocks and 191,000 rows in calendar. There is more than one result for each stock usually. I was thinking i could just create a new dataset out of it so it would go faster if i want to sort by dates, products, updates. etc.Just trying to figure out a way to see all the matches. If there is an easier way just through script I am open to it.
  3. Anyone? Beuller, Beuuuullllllerrrrrrr
  4. What would I add to the code if i want to place the new results into a new table and move the searched results into a "finished" table?
  5. S.Sname only contains what needs to be found within C.SName It can be anywhere in the field of C.SName When I type the query into the SQL line it says: #2013 - Lost connection to MySQL server during query
  6. I have the following code which works fine with the exception of timing out because there is a lot of data to filter through. Is there a way to create a new table either from the PHP script or from within SQL to stop it from timing out? $query = "SELECT s.SName, s.Symbol, c.`CD`, c.`FR`, c.`PCD` FROM Stocks s LEFT JOIN Calendar as c ON c.SName LIKE CONCAT('%', s.SName, '%' )LIMIT 200"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){
  7. I got this to work: $query = "SELECT s.SName, s.Symbol, c.`Primary Completion Date` FROM Stocks s LEFT JOIN Calendar as c ON c.SName LIKE CONCAT('%', s.SName, '%' )LIMIT 30"; Is there a way to remove the limit?
  8. @guru it says Lost connection to MySQL server during query $query = "SELECT s.SName, s.Symbol, c.`Primary Completion Date` FROM Stocks s LEFT JOIN Calendar as c ON c.SName LIKE CONCAT('%', s.SName, '%')"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo $row['SName'] ," ", $row['Symbol'] ; echo "<br />"; }
  9. $query = "SELECT s.SName, s.Symbol, c.`Primary Completion Date` FROM Stocks s LEFT JOIN Calendar as c LIKE %(SName)"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo $row['SName'] ," ", $row['Symbol'] ; echo "<br />"; Again, I have two tables. I basically want the script to only return the values in the calendar that have the same company in my stock list. Maybe I need to have the script create a 3rd table that creates a row for every match that is in the calendar?
  10. I am not trying to join IDs. I want a Fuzzy logic to make the determination.
  11. the problem is Calendar.SName has more then just the name in the field. I have stripped out all special characters so I think the LIKE statement should work but I keep getting errors or hangups.
  12. Hi All, I am having trouble getting my script to work. I have two tables. Stocks Calendar The stocks table only has two fields, Company and Symbol The Calendar table has a field with the same title SName. I would like to return the matching rows in the calendar that contain the company name from the Stocks Table along with a date field. I think utilizing the LIKE command is best. $query = "SELECT * FROM Stocks"; $query2 = "SELECT * FROM Calendar"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo $row['SName'] ," ", $row['Symbol'] ; echo "<br />"; } $result2 = mysql_query($query2) or die(mysql_error()); while($row2 = mysql_fetch_assoc($result2)){ echo $row2['SName'] ," ", $row2[''] ; echo "<br />"; } ?> <tr> <td><p><?php echo $row['Symbol']; ?></p></td> <td><p><?php echo $row['SName']; ?></p></td> <td><p><?php echo $row['Primary Completion Date']; ?></p></td> </tr> </table> </body> </html>
×
×
  • 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.