Welcome Guest, Not a member yet? Register   Sign In
scaffolding error
#1

[eluser]raghunath0610[/eluser]
hi every one,

i am trying to use scaffolding so i configured data base and made it as auto load.
and also changed $route['scaffolding_trigger'] in routes.php but iam geting an error

"Fatal error: Call to a member function num_rows() on a non-object in /home/ibridg5/public_html/tasteofandhra/codeigniter/system/database/drivers/mysql/mysql_driver.php on line 334"

pls help in this i am very new to CI ....

thanks,
raghunath.
#2

[eluser]TheFuzzy0ne[/eluser]
Hello. Welcome to the CodeIgniter forums.

Please show your code.
#3

[eluser]raghunath0610[/eluser]
Hi,
here is my code what i had written in my controller and the controller name is blog.php

<?php
class Blog extends Controller {
function Blog()
{
//echo 'this is constructer';
parent::Controller();
$this->load->scaffolding('tasteofandra');
}
} ?>

and my url is "http://tasteofandhra.com/codeigniter/index.php/blog/scaffolding"
when i am running above link i am getting this error "Fatal error: Call to a member function num_rows() on a non-object in home/ibridg5/public_html/tasteofandhra/codeigniter/system/database/drivers/mysql/mysql_driver.php on line 334"

pls help me in this

thanks,
Raghunath.
#4

[eluser]tonanbarbarian[/eluser]
add
Code:
$this->output->enable_profiler(true);
before the scaffold load

this will show you the queries that are run.
confirm that the query that is running is correct
if not then the structure of your table may not be correct for scaffolding to work
#5

[eluser]raghunath0610[/eluser]
Hi tonanbarbarian,
as per u r suggestion i added
$this->output->enable_profiler(true); this line in my code

and now my hole code is this

<?php
class Blog extends Controller {


function Blog()
{
//echo 'this is constructer';
parent::Controller();
$this->output->enable_profiler(true);
$this->load->scaffolding('tasteofandra');
}
} ?>

but still i am getting the same error
"Fatal error: Call to a member function num_rows() on a non-object in /home/ibridg5/public_html/tasteofandhra/codeigniter/system/database/drivers/mysql/mysql_driver.php on line 334"
#6

[eluser]Thorpe Obazee[/eluser]
I haven't used the scaffolding feature and just saw a note on the scaffolding page, that your table should have a primary key.
#7

[eluser]tonanbarbarian[/eluser]
oh yeah sorry, if fatal error it wont display the queries

is tasteofandra the name of the table?
does the table have a primary key?
can you supply the structure of the table
#8

[eluser]raghunath0610[/eluser]
Hi tonanbarbarian,

here is the structure of my table tasteofandra


CREATE TABLE IF NOT EXISTS `tasteofandra` (
`Id` int(50) NOT NULL auto_increment,
`LinkHeader` text NOT NULL,
`FilePath` text NOT NULL,
`GalleryTag` text NOT NULL,
`Genre` text NOT NULL,
`Hits` int(50) NOT NULL,
`UploadedBy` text NOT NULL,
`UploadTimeStamp` datetime NOT NULL,
`LastEditor` text NOT NULL,
`EditedTimeStamp` datetime NOT NULL,
`videopath` text NOT NULL,
`imagepath` text NOT NULL,
`ads` text NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2990 ;

pls let me know if u need any details.




Theme © iAndrew 2016 - Forum software by © MyBB