Coinbase

Author Topic: Can't figure out DB problem....  (Read 3345 times)

0 Members and 1 Guest are viewing this topic.

Offline tosp2

  • Newbie
  • *
  • Posts: 5
    • Email
Can't figure out DB problem....
« on: June 28, 2007, 10:01:46 am »
I am having to install this mod manually since I am using the Ig-Oh theme.  I got almost all of the mods done (except for an error on dispay_template.php) that I have to go back and fix, but I was attempting to ad the table to my database using phpMyAdmin using the instructions in one of the posts here.  So, I go into my DB, click on query and I put the following code into the box at the bottom that says SQL query on db name.

Code: [Select]
CREATE TABLE IF NOT EXISTS smf_ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0',
PRIMARY KEY (ADS_ID)

I got the following error:  "You have to choose at least one column to display"

I am not completely sure what I am doing, but the only other boxes in this query window are at the top that have a lot more things to fill out like Field, Sort, Criteria, an empty text box and modify boxes, etc.  So, I am not sure if I am doing this correctly or not, but can someone please explain a bit more on how to run these queries to add this table, or why I am getting this column error?  Thanks.

EDIT:  Ok, I played around some more and tried to use the SQL window at the top. I put the code above in and hit go and now I get the following error:

"#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 '' at line 21"

So, which one is the correct area and what can I do to fix these errors?  Thanks.
« Last Edit: June 28, 2007, 01:42:09 pm by tosp2 »

Offline tosp2

  • Newbie
  • *
  • Posts: 5
    • Email
Re: Can't figure out DB problem....
« Reply #1 on: June 28, 2007, 12:58:51 pm »
SOLVED!  There was a syntax error in the actual queries that are posted in another thread here, so the admins may want to check that.   There are no closing tags ); in any of the queries.  Luckily someone else was able to help and now I have the mod installed. 

Offline tosp2

  • Newbie
  • *
  • Posts: 5
    • Email
Re: Can't figure out DB problem....
« Reply #2 on: June 28, 2007, 01:49:31 pm »
Ok, I thought I had this figured out, but I need more help please.

So, once I got everything installed and the DB tables added, I attempted to upload my first ad.  I got the dreaded unknown category error in ads.php
So, I came back to the forum to look up this error, found a post that explained to add the category field into the table to which I did.  (added category, tinytext, under the posts line in the create smf_ads table query)

I thought this had fixed everything until I went back to my forum and realized ALL my posts were gone!  The post titles were there, but the post itself were blank/missing/gone.  I deleted all the ad files and went to add them in one at a time to find out where the problem was.   When I added in loadads.php into the source directory, my posts went away again, so there is obviously a problem with this file and the database.

When I had originally tried to install the first ad, I received an error in my error log that said "Undefined index: CATEGORY
File: /home/public_html/forum/Sources/LoadAds.php
Line: 42"

of which line 42 states 'category' => $row['CATEGORY'],
.....but I added the category column/link/whatever into my new smf_ads table using instructions from a post here somewhere.

I'm lost!  Can someone please help me figure this out?  Why is it when I add loadads.php onto my server, a lot of my table data disappears?  Why am I still receiving this undefined index error when I added the category line to the new table?  Can anyone shed some light on this for me and help me get this mod installed once and for all?  Thank you!
« Last Edit: June 28, 2007, 02:01:29 pm by tosp2 »

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Can't figure out DB problem....
« Reply #3 on: July 07, 2007, 10:45:45 am »
Why did you install the whole thing manually. ??? Was you package manager broke. ??? Were you trying to use it on a custom theme. ??? All you have to do to use it on a custom theme is:

1.) Install the mod
2.) Edit 4 template files in the theme you want to use
3.) That's it.


Offline tosp2

  • Newbie
  • *
  • Posts: 5
    • Email
Re: Can't figure out DB problem....
« Reply #4 on: July 09, 2007, 10:41:12 am »
I have a custom theme, which is why I had to install it manually. When I manually edited all the files and and loaded all the package files, I got some error that stated my smf_ads table was missing or something like that.  I did a forum search and found others with the same problem that had to manually add the tables and columns to their database using phpmyadmin, which I did.  Obviously something didnt go right, but Im not familiar enough with databases to know what it was. 

Do you or anyone else know what the problem might be?

When I load loadads.php, all my forum posts disappear and when I load it and try to add and ad, I get errors stating undefined index: category even though the category column was also added to the smf_ads table.

How do I fix this?   If I delete all the new smf_ads table in my database, I get the error that the table is missing.  If I leave it there, I cant use the mod.
« Last Edit: July 09, 2007, 10:44:11 am by tosp2 »

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Can't figure out DB problem....
« Reply #5 on: July 18, 2007, 05:40:23 pm »
I am not very good with databases, sorry. You did install it via the package manager and then only do the edits to the template files. ???

Offline babjusi

  • Jr. Member
  • **
  • Posts: 28
Re: Can't figure out DB problem....
« Reply #6 on: July 18, 2007, 09:21:23 pm »
Did you make a backup at least before installing the mod or tinkering with the db?

SMF Ads Support Forum

Re: Can't figure out DB problem....
« Reply #6 on: July 18, 2007, 09:21:23 pm »
.

 

.