News:

Help keep this project going by donating or buying adseller pro

Main Menu
Coinbase

Can't figure out DB problem....

Started by tosp2, June 28, 2007, 11:01:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tosp2

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.

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.

tosp2

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. 

tosp2

#2
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!

bigguy

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.


tosp2

#4
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.

bigguy

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. ???

babjusi

Did you make a backup at least before installing the mod or tinkering with the db?