- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
通过 phpmyadmin 来 self 的 MySQL 数据库的产品似乎没有显示在我的网站上。我正在使用 Netbeans 和 Wamp
代码:处理我的图像
<div class="catalogue_wrapper">
<div class="catalogue_wrapper_left">
<?php
$image = !empty($row['image']) ?
$objCatalogue->_path.$row['image'] :
$objCatalogue->_path.'unavailable.png';
$width = Helper::getImgSize($image, 0);
$width = $width > 120 ? 120 : $width;
?>
<a href="?page=catalogue-item&category=<?php echo $category['id']; ?>&id=<?php echo $row['id']; ?>"><img src="<?php echo $image; ?>" alt="<?php echo Helper::encodeHtml($row['name'], 1); ?>" width="<?php echo $width; ?>" /></a>
</div>
代码:应该显示我的产品
<div class="catalogue_wrapper_right">
<h4><a href="?page=catalogue-item&category=<?php echo $category['id']; ?>&id=<?php echo $row['id']; ?>"><?php echo Helper::encodeHtml($row['name'], 1); ?></a></h4>
<h4>Price: <?php echo Catalogue::$_currency; echo number_format($row['price'], 2); ?></h4>
<p><?php echo Helper::shortenString(Helper::encodeHtml($row['description'])); ?></p>
<p><?php echo Basket::activeButton($row['id']); ?></p>
</div>
</div>
每次我点击链接时,它都会显示我的错误消息。
如果您能提供任何帮助让这些产品显示在我的网络应用程序上,我们将不胜感激。
这是两个表的 SQL 转储
-- phpMyAdmin SQL Dump
-- version 4.1.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 23, 2014 at 03:06 AM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `tllecommerce`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `categories`
--
INSERT INTO `categories` (`id`, `name`) VALUES
(1, 'Liquorice'),
(2, 'Fudge'),
(3, 'Nougat'),
(4, 'Toffee'),
(5, 'Combination'),
(6, 'Allsorts'),
(7, 'Liquorice Straps');
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE IF NOT EXISTS `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`price` decimal(8,2) NOT NULL,
`date` datetime NOT NULL,
`category` int(11) NOT NULL,
`image` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `category` (`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=23 ;
--
-- Dumping data for table `products`
--
INSERT INTO `products` (`id`, `name`, `description`, `price`, `date`, `category`, `image`) VALUES
(1, 'Herbal Liquorice Straps', 'Cut your own straps!\r\n\r\nRolled liquorice sheets flavoured with the popular Chinese herbal extract Glycyrrhiza Glabra. Has the same medicinal and nutritional properties as Herbal Liquorice Bites but a slightly more intense flavour.', '8.00', '2014-03-17 07:59:43', 7, 'Blackstrapszoom.jpg'),
(2, 'Raspberry Sheets', 'Cut your own straps!\r\n\r\nThis is a tasty extrusion of the raspberry log, but with a more intense flavour.', '8.00', '2014-03-17 08:02:17', 7, 'raspberrystrapszoom.jpg'),
(3, 'Chocolate Liquorice Logs', 'Another “best seller”. Similar to the Rasso Choco except that the chocolate centre is wrapped in New Generation''s soft-chew herbal liquorice. \r\n\r\nIf you like liquorice, you will enjoy these. Like the rasso-choco keep it sealed in the fridge. Tip: Cut into short lengths and enjoy with vanilla ice-cream.', '8.00', '2014-03-17 08:05:14', 1, 'chocliqlogZoom.jpg'),
(4, 'Irish Moss Liquorice', 'Not truly a liquorice but a fresh soft jube impregnated with aniseed and covered with colourful hundreds and thousands. Often fought over in a pottle of Allsorts. This item has a long history in confectionery.', '8.00', '2014-03-17 08:08:12', 1, 'irishmosszoom.jpg'),
(5, 'Peaches and Cream Liquorice', 'Slightly piquant, but very pleasant on the palate, this tasty little number is sure to please. \r\n\r\nFlavoured with peach essence and mixed with artificial cream to keep unsaturated fats low, it tastes, as you might expect, of peaches and cream.', '8.00', '2014-03-17 08:09:00', 1, 'peachesNchreamzoom.jpg'),
(6, 'Liquorice Herbal Logs', 'Liquorice logs flavoured this time with something rather different: a popular Chinese herbal extract - Glycyrrhiza Glabra. \r\n\r\nGG runs a close-second to the well-known extract, Ginseng, used in Chinese herbal medicine.', '8.00', '2014-03-17 08:11:14', 1, 'softchewHerbLiqZoom.jpg'),
(7, 'Raspberry Chocolate Liquorice', 'Our ever-popular raspberry-flavoured roll wrapped around crunchy compound chocolate.\r\n\r\nThe cooler it is kept, the crunchier the chocolate becomes. \r\n\r\nIf you freeze it, just suck it until it becomes soft enough to eat. A tasty combination of flavours and textures. Keep the pottle sealed. A favourite with the younger set.', '8.00', '2014-03-17 08:14:00', 1, 'rassochocozoom.jpg'),
(8, 'Assorted Liquorice', 'Individually flavoured, lime, banana, plum and orange cubes in the traditional form: two liquorice and three paste (fruit) layers. Savour each flavour one cube at a time – and return for \r\na different flavour later.', '8.00', '2014-03-17 08:16:02', 6, 'allsortzoom.jpg'),
(9, 'Mini Bag Liquorice Allsorts', 'These versatile little bags are great for fund-raising (schools, clubs), for business promotions and/or give-aways to good customers or to encourage repeat business.\r\n\r\nFor schools & clubs the minimum order is 500 bags; for small businesses 100 bags.\r\n\r\nThe goods have a shelf life of 12 months.', '4.00', '2014-03-17 08:19:00', 6, 'minbag2zoom.jpg'),
(10, 'The Assorted Mini Pottle', 'Fill it with just one liquorice variety or any assortment from within the product range. \r\n\r\nMini pottles are popular in the business community as small give-away gifts of appreciation. A great value-for-money option.', '8.00', '2014-03-17 08:21:00', 6, 'minipottlezoom.gif'),
(11, 'Fruit Mix', 'Mixed fruity liquorice: apricot, blueberry, pineapple, kiwifruit and coconut – a combination you''re unlikely to find anywhere else. \r\n\r\nEach individual allsort contains natural fruit essence and an extra burst of flavour from dried fruit mixed into the paste. A delight for the taste buds.', '8.00', '2014-03-17 08:24:00', 6, 'MixedFruitzoom.jpg'),
(12, 'Chocolate Fudge', 'A chocolate flavoured fudge, light in texture and flavour. \r\n\r\nAnother high-quality NZ product using the best milk products and flavourings.', '8.00', '2014-03-17 08:26:00', 2, 'ChocZoom.jpg'),
(13, 'Liquorice Fudge', 'If you love liquorice this will be for you. Fudge that manages to combine the taste of liquorice with the texture and taste of fudge.', '8.00', '2014-03-17 08:27:00', 2, 'LiquoriceFudgeZoom.jpg'),
(14, 'Russian Fudge', 'A sweet and full-bodied fudge which is neither heavy nor tacky. More-ish. Uses the best available milk products and ingredients. Another long-lasting favourite.', '8.00', '2014-03-17 08:28:00', 2, 'RussianZoom.jpg'),
(15, 'Irish Creme Fudge', 'Lovers of Irish Creme will quickly identify its flavour in this finely textured fudge. \r\n\r\nLight, tasty, satisfying and not cloying. Long-lasting and made with the best ingredients.\r\n', '8.00', '2014-03-17 08:30:00', 2, 'IrishCremeZoom.jpg'),
(16, 'Ginger Liquorice Nougat', 'Added to the NGL mix for lovers of ginger.\r\nCrystallised ginger and liquorice are melted into nougat fresh from the ovens to give a tasty and beautifully balanced treat.\r\n\r\nThe ginger flavour slowly builds on the palate after about 20 seconds but is never too strong. One or two pieces are all you need.\r\n\r\nA great gift for more senior members of the family.', '8.00', '2014-03-17 08:31:00', 3, 'GingerLiqzoom.jpg'),
(17, 'Raspberry Nougat', 'One of our best sellers - pushing the factory into overtime to keep up with demand.\r\n\r\nRaspberry logs are melted into the nougat as soon as it comes from the ovens. If you enjoy a raspberry flavour you''ll certainly like this combination.\r\n\r\nThe product has the same texture as Liquorice Nougat - firm but not chewy.', '8.00', '2014-03-17 08:33:00', 3, 'RaspNougatzoom.jpg'),
(18, 'Pineapple Nougat', 'Promises to be popular! Freshly dried pineapple and pineapple essence give a strong pineapple flavour beautifully balanced by the nougat. \r\n\r\nAnother NZ-made product using the best of ingredients.', '8.00', '2014-03-17 08:34:00', 3, 'PineappleNougatZOOM.jpg'),
(19, 'Liquorice Nougat', 'Eating Ecstasy!\r\n\r\nLike Nougat? Then you''re bound to enjoy this - natural liquorice logs embedded in fresh nougat. \r\n\r\nThe nougat has the same consistency as the liquorice (firm but not chewy) and the two flavours are a unique blend.', '8.00', '2014-03-17 08:36:00', 3, 'LiqNougatzoom.jpg'),
(20, 'Toffee', 'Something different...\r\n\r\nThis is a rather soft chewing lolly with the liquorice and aniseed combining to produce subtle flavours. \r\n\r\nIndividually wrapped.', '8.00', '2014-03-17 08:38:00', 4, 'toffeeZoom.jpg'),
(21, 'Liquorice Combo', '700 grams of liquorice combination', '15.00', '2014-03-17 08:40:00', 5, NULL),
(22, 'Nougat Combo', '700 grams of nougat combination', '15.00', '2014-03-17 08:41:00', 5, NULL);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `products`
--
ALTER TABLE `products`
ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
最佳答案
在 phpMyAdmin 中运行此查询并检查是否收到任何结果,如果没有,则意味着您的数据库中不存在属于您尝试获取的类别的产品
$table1 = "products" ;
$table2 = "categories" ;
SELECT * FROM $table1 LEFT JOIN $table2 ON $table2.`category` = $table1.`id` WHERE $table1.`category` = $cat ORDER BY $table1.`date` DESC
关于php - 尝试在我的 netbeans php 项目中显示我的产品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22575090/
我正在使用 NetBeans 开发 Java 中的 WebService,并使用 gradle 作为依赖管理。 我找到了this article关于使用 gradle 开发 Web 项目。它使用 Gr
我正在将旧项目从 ant 迁移到 gradle(以使用其依赖项管理和构建功能),并且在生成 时遇到问题>eclipse 项目。今天的大问题是因为该项目有一些子项目被拆分成 war 和 jar 包部署到
我已经为这个错误苦苦挣扎了很长时间。如果有帮助的话,我会提供一些问题的快照。请指导我该怎么办????在我看来,它看起来一团糟。 *** glibc detected *** /home/shivam/
我在 Ubuntu 12.10 上运行 NetBeans 7.3。我正在学习 Java Web 开发类(class),因此我有一个名为 jsage8 的项目,其中包含我为该类(class)所做的工作。
我想知道 Codeplex、GitHub 等中是否有任何突出的项目是 C# 和 ASP.NET,甚至只是 C# API 与功能测试 (NUnit) 和模拟(RhinoMocks、NMock 等)。 重
我创建了一个 Maven 项目,包装类型为“jar”,名为“Y”我已经完成了“Maven 安装”,并且可以在我的本地存储库中找到它.. 然后,我创建了另一个项目,包装类型为“war”,称为“X”。在这
我一直在关注the instructions用于将 facebook SDK 集成到我的应用程序中。除了“helloFacebookSample”之外,我已经成功地编译并运行了所有给定的示例应用程序。
我想知道,为什么我们(Java 社区)需要 Apache Harmony 项目,而已经有了 OpenJDK 项目。两者不是都是在开源许可下发布的吗? 最佳答案 事实恰恰相反。 Harmony 的成立是
我正在尝试使用 Jsoup HTML Parser 从网站获取缩略图 URL我需要提取所有以 60x60.jpg(或 png)结尾的 URL(所有缩略图 URL 都以此 URL 结尾) 问题是我让它在
我无法构建 gradle 项目,即使我编辑 gradle 属性,我也会收到以下错误: Error:(22, 1) A problem occurred evaluating root project
我有这个代码: var NToDel:NSArray = [] var addInNToDelArray = "Test1 \ Test2" 如何在 NToDel:NSArray 中添加 addInN
如何在单击显示更多(按钮)后将主题列表限制为 5 个(项目)。 还有 3(项目),依此类推到列表末尾,然后它会显示显示更少(按钮)。 例如:在 Udemy 过滤器选项中,当您点击查看更多按钮时,它仅显
如何将现有的 Flutter 项目导入为 gradle 项目? “导入项目”向导要求 Gradle 主路径。 我有 gradle,安装在我的系统中。但是这里需要设置什么(哪条路径)。 这是我正在尝试的
我有一个关于 Bitbucket 的项目。只有源被提交。为了将项目检索到新机器上,我在 IntelliJ 中使用了 Version Control > Checkout from Ve
所以,我想更改我公司的一个项目,以使用一些与 IDE 无关的设置。我在使用 Tomcat 设置 Java 应用程序方面有非常少的经验(我几乎不记得它是如何工作的)。 因此,为了帮助制作独立于 IDE
我有 2 个独立的项目,一个在 Cocos2dx v3.6 中,一个在 Swift 中。我想从 Swift 项目开始游戏。我该怎么做? 我已经将整个 cocos2dx 项目复制到我的 Swift 项目
Cordova 绝对是新手。这些是我完成的步骤: checkout 现有项目 运行cordova build ios 以上生成此构建错误: (node:10242) UnhandledPromiseR
我正在使用 JQuery 隐藏/显示 li。我的要求是,当我点击任何 li 时,它应该显示但隐藏所有其他 li 项目。当我将鼠标悬停在文本上时 'show all list item but don
我想将我所有的java 项目(223 个项目)迁移到gradle 项目。我正在使用由 SpringSource STS 团队开发的 Gradle Eclipse 插件。 目前,我所有的 java 项目
我下载this Eclipse Luna ,对于 Java EE 开发人员,如描述中所见,它支持 Web 应用程序。我找不到 file -> new -> other -> web projects
我是一名优秀的程序员,十分优秀!