Optimising my database fields
Hi quick question, currently have following fields in my products table:
ProductName
ProductNameLink
Now ProductNameLink is the ProductName but replaces any spaces with hyphens (so that I can have SEO friendly URLS).
Im now thinking that this extra field in the table is not needed. because I can use php string replacement in my URL code.
Its not pulling any results though, here is the code:
Product=<?php echo str_replace(' ', '-',ucwords($rsProducts->getColumnVal("ProductName"))); ?>
<?php
$rsProduct = new WA_MySQLi_RS("rsProduct",$ecartdb,1);
$rsProduct->setQuery("SELECT *, REPLACE(ProductName, ' ', '-' ) FROM products WHERE products.ProductName = ? AND ProductEnabled = 1");
$rsProduct->bindParam("s", "".(isset($_GET['Product'])?$_GET['Product']:"") ."", "-1"); //colname
$rsProduct->execute();
?>
Chris