View Full Version : Wiping out my SQL data and starting fresh
Katana Man
02-12-2000, 02:56 AM
There has GOT to be some better MySQL tutorials for beginners than mysql.com![nbsp][nbsp]
Does anyone know of a website that can get me started?
On to the topic..[nbsp][nbsp]How can I wipe out the data already stored in my mysql database.
I tried DROP DATABASE, but it seemed to do nothing.
I'd like to start fresh, cuz I think I messed things up.
Dan Kaplan
02-12-2000, 03:13 AM
I agree that the MySQL documents make for pretty dry reading.[nbsp][nbsp]One of these days I'll get through them...
I'm currently trying to get phpMyAdmin set up (concurrent thread:[nbsp][nbsp]http://www.aota.net/ubb/Forum15/HTML/000288-1.html ).[nbsp][nbsp]From what I've read, it's invaluable for simplifying many aspects of interfacing with MySQL, providing easy point and click web use.[nbsp][nbsp]Here's their website:
http://www.htmlwizard.net/phpMyAdmin/
Just gotta figure out why it's not working for me...
Dan
Katana Man
02-12-2000, 03:15 AM
Thanks so much Dan, but I forgot to mention I'll be using Perl / MySQL.
I did figure out that this works:
drop table test4;
:)
[This message has been edited by Katana Man (edited 02-12-00@02:18 am)]
Dan Kaplan
02-12-2000, 03:25 AM
You're quite welcome.
If I'm not mistaken, the use of phpMyAdmin is not dependent on whether you use Perl or PHP.[nbsp][nbsp]It is merely a set of scripts that interface with the MySQL database.[nbsp][nbsp]Of course, I haven't gotten it working yet, so my comments are pretty meaningless at this point...[nbsp][nbsp];)
Sort of related:[nbsp][nbsp]phpAds (same programmer) has its demo running on a .html page.[nbsp][nbsp]Does this mean that the ad banner program is written in PHP but that it can be called from standard HTML/SHTML pages, or must it be called from php3 pages?[nbsp][nbsp]Can you tell today's my first day with php?[nbsp][nbsp]:)
Disregard
Stephen
02-12-2000, 04:19 AM
katana,
i thought i'd mention how i came to grips with MySQL and Perl. i located a script written by Mike Miller as a DBI::DBD tutorial. here's an abstract taken from one of the 2 files involved:
# build.cgi
# Author: Mike Miller (mke@netcom.com)
# Purpose: Import state and zip code data from flat text
# files and build a searchable MySQL database. The database
# will allow place names and (1990) census populations to
# be returned for a given user-provided zipcode. See the
# accompanying script places.cgi for the web interface
# to the database.
#
# Tables to be populated are: States, ZipCodes,
# Places, and ZipToPlace
OK. it sounds like boring stuff, and the original version of the program i downloaded seemed to have degraded. but after rewriting it a little it taught me what i needed to know to get going on this stuff. and it's not really a trivial example because it includes complications like the same zipcode being shared by 2 different states (yeah, that actually happens for 3 out of 30,000 or so zips--i thought it was a data error, but no...)
if you'd like to study these scripts, let me know and i'll send them your way. i meant to write a tutorial for others to use but never got around to it. one of these days.
p.s. i don't think the DBI::DBD interface is as simple as using the functions that php provides. however, you can get around this by defining short subroutines that mimic the more common php mysql functions, and that sweeps most of the confusing interface right under the rug (and it's what i do--although that's something i learned after playing around with the above-mentioned scripts, which still have the raw DBI::DBD code in them).
Dan,
Sort of related:[nbsp][nbsp]phpAds (same programmer) has its demo running on a .html page.[nbsp][nbsp]Does this mean that the ad banner program is written in PHP but that it can be called from standard HTML/SHTML pages, or must it be called from php3 pages?
I'm trying to do the same kind of thing, only with MyAdServer (recommended by Deb here a while back), and I got all the way to the last step and bombed out. In their install doc, they said to insert the code into the web page html code. I did that and tried loading the file both as html and php3 files and neither worked. However, when I load the code alone as a .php3 file, it works fine. I believe (hope?) it can be called from html, but haven't figured out how. Any php experts around here? (also there are some issues with path; somtimes /big/dom is a good thing, sometimes not.) Hmmm, can you tell today's my first day with php too?[nbsp][nbsp]
Ken
Dan Kaplan
02-13-2000, 12:28 AM
Hi Ken,
That's pretty much what I feared.[nbsp][nbsp]There are few things more frustrating than installing scripts that may or may not work, especially when the site has virtually zero documentation as to how to use them...[nbsp][nbsp]I would like to switch to a different banner rotation script, but I defintely don't want to change all my shtml pages to php3.
Docs?
fear not dan !!!!
I use PHP on all my shtml pages using SSI
<!--#include virtual="/ads/ads-bot-doubanner.php3" -->
Works like a champ!
Dan Kaplan
02-13-2000, 01:12 AM
Excellent, thanks Dean![nbsp][nbsp]That's enough potential to chase the elusive pot of gold.
Dan
Hi Dean,
Thanks for the .shtml code. That gets me a big part of the way. For the rest, another question...
Is there any way to include php references in regular html code? ie, .htm, .html, etc files.
Ken
I never figured out how to do that but I understand that in the .htaccess file you can adjust the file types and how they act (or are interpreted) I will dig for that info today.
So far I have only run php code from shtml, phtml amd php3 extentions
andre
02-13-2000, 05:36 PM
Just have an .htaccess file that php-parses .html files in the directory:
AddType application/x-httpd-php3 .html
But this only makes sense if all your .html files should be parsed for php, cause it will make your regular .html pages load up a little slower. I once had all .htm files parsed and left the .html files untouched :)
Shalazar
02-13-2000, 06:08 PM
So basically you have to have a separate .htaccess file in each directory in which you're including php code into an .html .shtml .htm file for it to work?
andre
02-13-2000, 06:48 PM
No, basically you can do the following:
Because apache searches for an .htaccess in every directory upwards the requested directory, you can have an .htaccess in your main directory and not worry about the subdirectories. The following example might be more helpful:
Directory:
/www/
[nbsp]|
[nbsp]|->/www/example/.htaccess(AddType application/x-httpd-php3 .html)
[nbsp]|[nbsp][nbsp][nbsp][nbsp]|
[nbsp]|[nbsp][nbsp][nbsp][nbsp]|->/www/example/moreexample/index.html(parsed)
[nbsp]|[nbsp][nbsp][nbsp][nbsp]|
[nbsp]|[nbsp][nbsp][nbsp][nbsp]|->/www/example/moreexample2/index.html(parsed)
[nbsp]|
[nbsp]|->/www/anotherexample/index.html (not parsed)
Uhoh, I hope this is clear...
--
andre
[This message has been edited by andre (edited 02-13-00@5:49 pm)]
Thanks for your help. That's all very interesting -- and very tricky (for me). I'm going to try and get this to work. Thanks again.
Ken
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.