Hi David,
On a feed I have, the Image URL is rather long on some products and the end of the URL is being cut off and so on those products the image isn't showing/it's broken.
What do I need to do to ensure that the full URL from the feed is imported into the database please?
Thank you :)
Hi David,,
Could a similar sort of thing be done for the category name provided by the feed?
I've realised that part of the category names are being cut off which has made mapping awkward.
Thanks.
Hi,
Sure - the category field is part of a compound index so can't be made so big but can be increased to around 150 characters with the following dbmod.php script;
<?php
set_time_limit(0);
require("includes/common.php");
$config_databaseDebugMode = TRUE;
$sql = "ALTER TABLE `".$config_databaseTablePrefix."products`
CHANGE `category` `category` VARCHAR(150) NOT NULL default ''";
database_queryModify($sql,$result);
print "Done.";
?>
Cheers,
David.
--
PriceTapestry.com
Hi David,
Thank you. I tried the running the code you attached and received this:
[ALTER TABLE `products` CHANGE `category` `category` VARCHAR(150) NOT NULL default ''][Specified key was too long; max key length is 1000 bytes]Done.
Ah sorry about that; 96 should be OK using
<?php
set_time_limit(0);
require("includes/common.php");
$config_databaseDebugMode = TRUE;
$sql = "ALTER TABLE `".$config_databaseTablePrefix."products`
CHANGE `category` `category` VARCHAR(96) NOT NULL default ''";
database_queryModify($sql,$result);
print "Done.";
?>
Cheers,
David.
--
PriceTapestry.com
Looks like it's coming up with the same thing.
[ALTER TABLE `products` CHANGE `category` `category` VARCHAR(96) NOT NULL default ''][Specified key was too long; max key length is 1000 bytes]Done.
Does the VARCHAR go up in certain increments or can I try any number less than 96 to see if it takes effect?
That's strange it does rely on underlying data storage but yes it's fine to reduce the number but I would suggest a decrement in reasonable powers of 2 downwards e.g. 8 so try in this order;
VARCHAR(88)
VARCHAR(80)
VARCHAR(72)
Cheers,
David.
--
PriceTapestry.com
VARCHAR(72) seemed to be the magic number.
Thanks!
Hi,
Here's a dbmod.php script to change the image_url to 1024 characters...
<?php
set_time_limit(0);
require("includes/common.php");
$sql = "ALTER TABLE `".$config_databaseTablePrefix."products`
CHANGE `image_url` `image_url` VARCHAR(1024) NOT NULL";
database_queryModify($sql,$result);
print "Done.";
?>
Cheers,
David.
--
PriceTapestry.com