php, coldfusion and general web development waffle

for all net-related stuff
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

has anyone ever heard of a dump file?

i found some bit of software that was supposed to convert my existing database into a mysql database, and it had some problems and didn't work like it reckoned it should, but in erroring created a dump.sql file

its just a text file full of sql statements, to make all the tables with the proper field types, and then populate those tables with the data from the original database - but i was wondering how i can actually get mysql, through that phpadmin bit i guess, to execute everything in the file?

the file is just like this;

CREATE DATABASE IF NOT EXISTS `db1`;
USE `db1`;

#
# Table structure for table 'Countries'
#

DROP TABLE IF EXISTS `Countries`;

CREATE TABLE `Countries` (
`CountryID` INTEGER NOT NULL AUTO_INCREMENT,
`Country` VARCHAR(255),
`PostageArea` INTEGER,
`PostageSequence` INTEGER DEFAULT 0,
INDEX (`CountryID`),
PRIMARY KEY (`CountryID`)
) ENGINE=myisam DEFAULT CHARSET=utf8;

SET autocommit=1;

#
# Dumping data for table 'Countries'
#

INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (1, 'Afghanistan', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (2, 'Albania', 2, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (3, 'Algeria', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (4, 'American Samoa', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (5, 'Andorra', 2, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (6, 'Angola', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (7, 'Anguilla', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (8, 'Antarctica', 3, 0);
INSERT INTO `Countries` (`CountryID`, `Country`, `PostageArea`, `PostageSequence`) VALUES (9, 'Antigua', 3, 0);

and on and on for all the data in each table and through all the tables

actually, now i've typed this in, i could probably just write a coldfusion page to execute all this, if i can get the basic database file created and a datasource linking it with coldfusion ... hmmm :?
User avatar
faceless
Posts: 27066
Joined: Tue Apr 25, 2006 6:16 pm

Post by faceless »

ok, that's what I was talking about earlier about everything being in one. You should just be able to install it by clicking on 'import' in myphpadmin.

Make sure you've selected the correct database on the left first though... though you probably don't have more than one
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

many thanks for your help faceless, you're a star! :)

if you ever need any help with coldfusion, photoshop or anything i know about, let me know!

i think i'm going to learn mysql properly soon, it'll make things easier and more portable for the future
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

edit - problem solved, and deleted :)

Image
Last edited by luke on Tue Oct 30, 2012 4:22 pm, edited 1 time in total.
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

problem solved :)

but now i've posted the above table layout, does that look normal to you mysql people?
User avatar
faceless
Posts: 27066
Joined: Tue Apr 25, 2006 6:16 pm

Post by faceless »

Here's an interesting page. I've never used linux, but it explains a lot very clearly.

[web]https://www.yolinux.com/TUTORIALS/LinuxT ... MySQL.html[/web]
User avatar
Brown Sauce
admin
Posts: 1485
Joined: Sun Jan 07, 2007 3:40 pm

Post by Brown Sauce »

you can install oracle virtual box, it's free

https://www.virtualbox.org/

and use that to host a linux or mac or win3.1 os.

If you are doing any work at all it's usefull. The wamp xamp stuff is ok, but you can get much better speeds with linux on this sort of setup.

Learn to use the terminal and it gets quicker ...

I've nearly got the facebook clone together btw. It's a long process part time on ur own :)
User avatar
major.tom
Macho Business Donkey Wrestler
Posts: 1990
Joined: Sun Jan 21, 2007 7:07 pm
Location: BC, Canada

Post by major.tom »

Brown Sauce wrote:I've nearly got the facebook clone together btw. It's a long process part time on ur own :)
If this site is intended for couchtrippers, the name AssGroove might suit...
User avatar
Brown Sauce
admin
Posts: 1485
Joined: Sun Jan 07, 2007 3:40 pm

Post by Brown Sauce »

I am looking for a name, dunno about assgroove though :)

if and when it gets going there could always be an assgroove group ...
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

has anyone done anything, or used anything, to prevent spam being submitted on pages on a site?

i did a site a couple of months back, and the amount of spam they get is crazy - 600 odd in the past week posted on one comments page, and loads being submitted via the contact page that gets emailed to them

would something as simple as select what day it is today stop them? i don't really want to have to use one of the strange image things where you have to work out the characters, and i haven't really got the time at the moment to be coding something decent - i just want something quick and easy, or something i can just plug in!
User avatar
faceless
Posts: 27066
Joined: Tue Apr 25, 2006 6:16 pm

Post by faceless »

the best way for the emails is to make a form page that doesn't show the actual address.

As for the spam, I suggest region blocking if that's practical for the site concerned. If you add a comment system like Disqus' then they do most of the spam filtering for you. though setting the posts to require moderation might be the best answer.
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

the email page is just a form - the email address isn't shown, but the spam thing just fills in the form and submits it, so it gets emailed

i've just done a quick scan of google for possible solutions, one seems to be adding a hidden text area, the spam system won't know its hidden and will complete it - so if thats filled in its spam. another is checking the time taken to submit the form, a spam system will do it really quick

another possible solution i saw was just asking what fruit beings with a! i might just try something quick and simple like that for now, although i'll have a look at that disqus system when i've got more time
User avatar
faceless
Posts: 27066
Joined: Tue Apr 25, 2006 6:16 pm

Post by faceless »

yeah, with the reg page here I added a question and that really cut down the spammers by a good 95% (it was a mod by someone else that I was able to include).

Disqus is good for sure - I was always worried about using a separate company to store data like that, but it's been around for a few years now and a lot of big sites use it so I reckon it's safe now.
User avatar
Brown Sauce
admin
Posts: 1485
Joined: Sun Jan 07, 2007 3:40 pm

Post by Brown Sauce »

did you see this one luke,

https://www.bennadel.com/blog/2149-The-A ... -Board.htm

it's even got all the code.
User avatar
luke
admin
Posts: 5654
Joined: Sun Feb 11, 2007 5:32 pm
Location: by the sea

Post by luke »

thanks sauce, i have checked that guys site before, but i'd not seen that. i did a google for cold fusion and spam protection and found some coldfusion plugin for the recaptcha image thing but i don't really want to have to go down that image route.

i'll have a proper look at this later, thanks

for now i think i'll go for something simple like this ...

Image

:lol:
Post Reply