Webmastersite.net
Register Log In

Database error when add sub-category

Comments on Database error when add sub-category

Sunburnt
Beginner

Usergroup: Customer
Joined: Sep 04, 2006

Total Topics: 4
Total Comments: 5
Posted Sep 09, 2006 - 2:04 AM:

Hi Paul,

I had encountered the following error upon submission of a new sub-category:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/site/public_html/classes/database.php on line 108

Performing query: SELECT COUNT(id) FROM wsnlinks_membergroups WHERE 1=1 ;

Performing query: SELECT title FROM wsnlinks_membergroups WHERE id=1 ;

Performing query: SELECT title FROM wsnlinks_membergroups WHERE id=2 ;

Performing query: SELECT title FROM wsnlinks_membergroups WHERE id=3 ;

Performing query: SELECT parent FROM wsnlinks_categories WHERE alias= ORDER BY id ASC ;

Number of rows is for 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 'ORDER BY id ASC' at line 1

Performing query: SELECT COUNT(id) FROM wsnlinks_categories WHERE isalbum=0 AND deleted=0 AND moderators LIKE '%, 2[,]%' ;

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 'ORDER BY id ASC' at line 1

Where can I correct the query where the "WHERE alias=" is empty?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 09, 2006 - 12:29 PM:

I can't reproduce any problem. Give me a prodcedure -- are you guest or admin, is the category selector switched on or off, are you selecting something specific for particular fields (such as secondary categories)?
Sunburnt
Beginner

Usergroup: Customer
Joined: Sep 04, 2006

Total Topics: 4
Total Comments: 5
Posted Sep 09, 2006 - 8:23 PM:

Ok, I tested using Admin, a Normal user login or Guest, all encountered the same error.

Switches for category views Off, Show subcategories on main page On, Category selector on 'Suggest Link' page Off.

I'm attempting to submit Level 2 subcategory under Level 0 Top cat -> Level 1 cat ->New Category.

The error appeared if user does not enter any fields in the form and attempt to submit.


Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 10, 2006 - 8:27 AM:

Fixed.
   $template->categoryreplacements($blankcat);
->
   $template->replace('{CATALIASIDVALUES}', $aliasids);   
$template->categoryreplacements($blankcat);
in suggest.php.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.