- 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/
我需要将文本放在 中在一个 Div 中,在另一个 Div 中,在另一个 Div 中。所以这是它的样子: #document Change PIN
奇怪的事情发生了。 我有一个基本的 html 代码。 html,头部, body 。(因为我收到了一些反对票,这里是完整的代码) 这是我的CSS: html { backgroun
我正在尝试将 Assets 中的一组图像加载到 UICollectionview 中存在的 ImageView 中,但每当我运行应用程序时它都会显示错误。而且也没有显示图像。 我在ViewDidLoa
我需要根据带参数的 perl 脚本的输出更改一些环境变量。在 tcsh 中,我可以使用别名命令来评估 perl 脚本的输出。 tcsh: alias setsdk 'eval `/localhome/
我使用 Windows 身份验证创建了一个新的 Blazor(服务器端)应用程序,并使用 IIS Express 运行它。它将显示一条消息“Hello Domain\User!”来自右上方的以下 Ra
这是我的方法 void login(Event event);我想知道 Kotlin 中应该如何 最佳答案 在 Kotlin 中通配符运算符是 * 。它指示编译器它是未知的,但一旦知道,就不会有其他类
看下面的代码 for story in book if story.title.length < 140 - var story
我正在尝试用 C 语言学习字符串处理。我写了一个程序,它存储了一些音乐轨道,并帮助用户检查他/她想到的歌曲是否存在于存储的轨道中。这是通过要求用户输入一串字符来完成的。然后程序使用 strstr()
我正在学习 sscanf 并遇到如下格式字符串: sscanf("%[^:]:%[^*=]%*[*=]%n",a,b,&c); 我理解 %[^:] 部分意味着扫描直到遇到 ':' 并将其分配给 a。:
def char_check(x,y): if (str(x) in y or x.find(y) > -1) or (str(y) in x or y.find(x) > -1):
我有一种情况,我想将文本文件中的现有行包含到一个新 block 中。 line 1 line 2 line in block line 3 line 4 应该变成 line 1 line 2 line
我有一个新项目,我正在尝试设置 Django 调试工具栏。首先,我尝试了快速设置,它只涉及将 'debug_toolbar' 添加到我的已安装应用程序列表中。有了这个,当我转到我的根 URL 时,调试
在 Matlab 中,如果我有一个函数 f,例如签名是 f(a,b,c),我可以创建一个只有一个变量 b 的函数,它将使用固定的 a=a1 和 c=c1 调用 f: g = @(b) f(a1, b,
我不明白为什么 ForEach 中的元素之间有多余的垂直间距在 VStack 里面在 ScrollView 里面使用 GeometryReader 时渲染自定义水平分隔线。 Scrol
我想知道,是否有关于何时使用 session 和 cookie 的指南或最佳实践? 什么应该和什么不应该存储在其中?谢谢! 最佳答案 这些文档很好地了解了 session cookie 的安全问题以及
我在 scipy/numpy 中有一个 Nx3 矩阵,我想用它制作一个 3 维条形图,其中 X 轴和 Y 轴由矩阵的第一列和第二列的值、高度确定每个条形的 是矩阵中的第三列,条形的数量由 N 确定。
假设我用两种不同的方式初始化信号量 sem_init(&randomsem,0,1) sem_init(&randomsem,0,0) 现在, sem_wait(&randomsem) 在这两种情况下
我怀疑该值如何存储在“WORD”中,因为 PStr 包含实际输出。? 既然Pstr中存储的是小写到大写的字母,那么在printf中如何将其给出为“WORD”。有人可以吗?解释一下? #include
我有一个 3x3 数组: var my_array = [[0,1,2], [3,4,5], [6,7,8]]; 并想获得它的第一个 2
我意识到您可以使用如下方式轻松检查焦点: var hasFocus = true; $(window).blur(function(){ hasFocus = false; }); $(win
我是一名优秀的程序员,十分优秀!