I thought I could figure this out on my own, but apparently I am struggling with it. I had originally the following code:
$query = "SELECT cards.card_id,title,description,meta_description,seo_keywords,price FROM cards,card_cheapest WHERE cards.card_id = card_cheapest.card_id ORDER BY card_id";
$result = mysql_query($query);
// Open file for writing
$myFile = "googleproducts.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
// Loop through returned data and write (append) directly to file
fprintf($fh, "%-200s %-200s %-800s %-200s %-800s\n", "id", "label","description","price","seo keywords");
fprintf($fh, "\n");
while ($row = mysql_fetch_assoc($result)) {
fprintf($fh, "%-200s %-200s %-800s %-200s %-800s\n", $row['card_id'], $row['title'], $row['description'],$row['price'], $row['seo_keywords']);
}
// Close out the file
fclose($fh);
?>
What I needed to do was add "By Amy" to the title when the file was printing to a text file, so I thought was I wouldconcat it like so:
$query = "SELECT cards.card_id,concat(title, "By Amy"),description,meta_description,seo_keywords,price FROM cards,card_cheapest WHERE cards.card_id = card_cheapest.card_id ORDER BY card_id";
Everytime I would try to run the file, I would get an error saying "( ! ) Parse error: syntax error, unexpected T_STRING in C:\wamp\www\output.php on line 22" . I know the query works in my sequel pro, but when I try to incorporate it in the actual file it files