4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Newbie help with entering stuff into MySQL
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
frost4thx
Junior WebHelper
Junior WebHelper


Joined: 14 Jun 2003
Posts: 1

PostPosted: Sat Jun 14, 2003 9:19 pm (20 years, 10 months ago) Reply with QuoteBack to Top

first off, lemme say im really sorry lol... i have no idea how to work mysql, and im just getting started with php..
im trying to install a notification mod thingy for phpbb2 so people can be notified whenever a forum has a new topic

the instruction manual said

Code:
#################################################################
##
## Author Note:
##
## This mod adds a "watch this forum" link to the viewforum page, similar to the
## "watch this topic" link on viewtopic. further on, this mod changes the structure
## of email bodies, now including the post text, the name of the poster etc. in the
## email.
## there are different email texts for watched topic (reply), watched forum (newtopic) and
## watched forum (reply).
## the texts are available both in english and german
##
## security should be ok, you are not able to receive a notification email if the forum is private
## and you are not allowed to read!
##
## Do not forget to run the following commands on your sql database (replace phpbb2_ with your db prefix):
##
## CREATE TABLE phpbb2_forums_watch (
##    forum_id smallint(5) unsigned NOT NULL default '0',
##    user_id mediumint(8) NOT NULL default '0',
##    notify_status tinyint(1) NOT NULL default '0',
##    KEY forum_id (forum_id),
##    KEY user_id (user_id),
##    KEY notify_status (notify_status)
## )
##
## ALTER TABLE phpbb2_forums
##    ADD forum_notify TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL
##    AFTER forum_last_post_id
##
## the description is for subsilver theme users, it should work with every theme
## if you are using the files from the package you only have to run the sql command
##
## this mod was tested on phpBB 2.0.0
##
## Should be no problem for any user who knows what they are doing ;-)
##
#################################################################


how do i add this? thanks alot in advance... Crying or Very sad
OfflineView User's ProfileFind all posts by frost4thxSend Personal Message
Riker
Junior WebHelper
Junior WebHelper


Joined: 01 Mar 2003
Posts: 14
Location: AR, USA

PostPosted: Sat Jun 14, 2003 11:58 pm (20 years, 10 months ago) Reply with QuoteBack to Top

do you have phpMyAdmin? if so...go to the database phpBB is in, and click on the SQL tab...a page should load with a box in it where you can enter code...copy
Code:
CREATE TABLE phpbb2_forums_watch (
    forum_id smallint(5) unsigned NOT NULL default '0',
    user_id mediumint(8) NOT NULL default '0',
    notify_status tinyint(1) NOT NULL default '0',
    KEY forum_id (forum_id),
    KEY user_id (user_id),
    KEY notify_status (notify_status)
 )
and paste it in that box and hit go...

then copy
Code:
ALTER TABLE phpbb2_forums
    ADD forum_notify TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL
    AFTER forum_last_post_id
and paste it into that box...and it go
OfflineView User's ProfileFind all posts by RikerSend Personal MessageSend emailVisit Poster's WebsiteAOL Instant MessengerYahoo MessengerICQ Number
Kdawg
Senior WebHelper
Senior WebHelper


Joined: 21 Apr 2003
Posts: 153

PostPosted: Sun Jun 15, 2003 11:54 pm (20 years, 10 months ago) Reply with QuoteBack to Top

If you dont have phpMyAdmin, you could just put it in a php file like createtable.php, and put the code
Code:

<?
$username = "username goes here"
$password = "pasword goes here"
$database = "database name goes here"
$db = mysql_connect("localhost","$username","$password");
mysql_select_db("$database",$db);
mysql_query("CREATE TABLE phpbb2_forums_watch ( forum_id smallint(5) unsigned NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', notify_status tinyint(1) NOT NULL default '0', KEY forum_id (forum_id), KEY user_id (user_id), KEY notify_status (notify_status)");
mysql_query("ALTER TABLE phpbb2_forums ADD forum_notify TINYINT(1) UNSIGNED DEFAULT '1' NOT NULL AFTER forum_last_post_id");
?>

in it. Then run it by calling it in your browser, you would go to www.yoursite.com/createtable.php.


Last edited by Kdawg on Mon Jun 16, 2003 5:09 pm, edited 2 times in total
OfflineView User's ProfileFind all posts by KdawgSend Personal Message
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Mon Jun 16, 2003 6:58 am (20 years, 10 months ago) Reply with QuoteBack to Top

Putting the code into a php file will work, yes, but you have to add the commands to connect to your database as well. Otherwise it won't know where to put the database tables. Wink

Also, you should check your prefix that you used when installing the software. You can find it in your config.php file, in case you don't remember what it is. Use that prefix instead of 'phpBB2' if you have changed it to something else.

Dave

________________________________
Dave
Photography Site :: Query Tools Forum :: Weekend Fun
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Kdawg
Senior WebHelper
Senior WebHelper


Joined: 21 Apr 2003
Posts: 153

PostPosted: Mon Jun 16, 2003 2:27 pm (20 years, 10 months ago) Reply with QuoteBack to Top

I did forgot the connect, but I added it so all you have to do is put in you info in where it says and it should work.
OfflineView User's ProfileFind all posts by KdawgSend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Mon Jun 16, 2003 2:39 pm (20 years, 10 months ago) Reply with QuoteBack to Top

Don't you still need to run the queries? something like this???
Code:
mysql_query("CREATE TABLE phpbb2_forums_watch (forum_id smallint(5) unsigned NOT NULL default '0', user_id mediumint(8) NOT NULL default '0', notify_status tinyint(1) NOT NULL default '0', KEY forum_id (forum_id), KEY user_id (user_id), KEY notify_status (notify_status))")
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Kdawg
Senior WebHelper
Senior WebHelper


Joined: 21 Apr 2003
Posts: 153

PostPosted: Mon Jun 16, 2003 5:10 pm (20 years, 10 months ago) Reply with QuoteBack to Top

I keep forgeting stuff, I think I got it though.
OfflineView User's ProfileFind all posts by KdawgSend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Mon Jun 16, 2003 6:52 pm (20 years, 10 months ago) Reply with QuoteBack to Top

Kdawg wrote:
I keep forgeting stuff, I think I got it though.


Very Happy Join the club!!
I think 90% of the PHP I write is just copy and pasted from scripts I've written in the past because I can never remember the correct way.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Kdawg
Senior WebHelper
Senior WebHelper


Joined: 21 Apr 2003
Posts: 153

PostPosted: Mon Jun 16, 2003 10:10 pm (20 years, 10 months ago) Reply with QuoteBack to Top

I'm glad im not the only one Laughing.
OfflineView User's ProfileFind all posts by KdawgSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Jun 17, 2003 7:03 am (20 years, 10 months ago) Reply with QuoteBack to Top

Just remember that "practice makes perfect", so keep trying! The more you use a certain function, the easier it'll be to remember it. This helps save valuable time, instead of looking in other scripts you've written, or using the PHP manual.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.323907 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme