Wrox Programmer Forums
|
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2009, 01:06 PM
Registered User
 
Join Date: Nov 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default i have 2 error, help me please

hi i new on this codeigniter so i still dont know what the problem of this error
so help me to resolve it please, thank

A PHP Error was encountered

Severity: Notice

Message: Undefined index: id

Filename: controllers/welcome.php

Line Number: 15

for the database


A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `status` = 'active' ORDER BY `category_id` asc LIMIT 100' at line 4

SELECT `id`, `name`, `thumbnail`, `category_id` FROM (`products`) WHERE `id` != AND `status` = 'active' ORDER BY `category_id` asc LIMIT 100
 
Old November 17th, 2009, 12:45 PM
Wrox Author
 
Join Date: May 2008
Posts: 53
Thanks: 0
Thanked 5 Times in 5 Posts
Default hmmmm.....

Okay, here's the function in the Welcome controller:
Code:
  function index(){	
  	$this->output->cache(30);
	$data['title'] = "Welcome to Claudia's Kids";
	$data['navlist'] = $this->MCats->getCategoriesNav();
	$data['mainf'] = $this->MProducts->getMainFeature();
	$skip = $data['mainf']['id'];
	$data['sidef'] = $this->MProducts->getRandomProducts(3,$skip);
	$data['main'] = 'home';
	$this->load->vars($data);
	$this->load->view('template');
  }
It appears that the $this->MProducts->getMainFeature() function isn't returning a value. Which means that the products db table is empty.

This probably means that you've jumped ahead :) and are looking at the code before you go through the book. That's okay. Just enter a product into the database table using PHPMYADMIN, it can be anything you want.
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
The Following User Says Thank You to myerman For This Useful Post:
peter_kung (November 17th, 2009)
 
Old November 17th, 2009, 01:03 PM
Registered User
 
Join Date: Nov 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

it's work, thank you, i thought just simply create the database only, and i didnt insert any data on it,





Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote Connection Error: Named Pipes Provider error hbansal ASP.NET 2.0 Basics 5 April 12th, 2009 09:51 AM
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.