Hi Everyone,
A bit of help needed as my MYSQL is terrible.
I have a database that looks as follows:
I then have a php script that can read the text document here:Code:attribute id - value 64 - 109.txt 109 - some other data 110 - some other data 64 - 110.txt 109 - some other data 110 - some other data
I need to grab that text file from my database, where attribute id = 64 leaving the "other data" as it is. Then open the txt file in php and put the contents back into that exact field it got them from.Code:<?php $lines = file('http://www.mywebsite.com/files.txt'); ?>
the table name is "mage_catalogsearch_fulltext" for reference
The reason for me doing this is the product descriptions are all inside those text documents, and I need to suck them out and put the actual content into that field rather than the file reference
I am more of a designer but am piecing the php together slowly so far I am connecting to the database and trying to get the files:
This does not do the job howeverCode:<? mysql_connect ("localhost","cpsdev_mage1","**********"); mysql_select_db ("cpsdev_mage1"); $sql = "select 'value' from mage_catalogsearch_fulltext WHERE 'Attribute_id' = 64"; $result = mysql_query ($sql) or die($myQuery."<br/><br/>".mysql_error()); while($row = mysql_fetch_array($result)) { echo $row['value']; } ?>
Any help is greatly appreciated. Simon


Reply With Quote
Bookmarks