Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do this

Status
Not open for further replies.

Wulfgen

Technical User
Dec 31, 2004
283
US
I have inherited a set of files that requires access to a mysql db (and I dont know a darn thing about db, but, am willing to learn)

The db uses this script - below to write tables and records to the db (or supposedly does - I could be wrong) I made the DB OK and have it recognized by the admin script however its looking for records and tables that don't exist... yet...

here is the db install script
Code:
--
-- Create schema phpstorelocator
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ phpstorelocator;
USE phpstorelocator;

DROP TABLE IF EXISTS `slstate`;
CREATE TABLE `slstate` (
  `stateID` int(10) unsigned NOT NULL auto_increment,
  `statename` varchar(100) default '',
  `recordlastmodified` timestamp NOT NULL default '0000-00-00 00:00:00',
  `recordlastmodifiedby` varchar(50) default '',
  `recordcreated` timestamp NOT NULL default '0000-00-00 00:00:00',
  `recordcreatedby` varchar(50) default '',
  PRIMARY KEY  (`stateID`)
);


DROP TABLE IF EXISTS `slstore`;
CREATE TABLE `slstore` (
  `storeID` int(10) unsigned NOT NULL auto_increment,
  `companystoreID` varchar(50) default '',
  `storename` varchar(100) default '',
  `address` varchar(100) default '',
  `city` varchar(50) default '',
  `suburb` varchar(50) default '',
  `stateID` int(10) unsigned default '0',
  `country` varchar(50) default '',
  `zippostcode` varchar(20) default '',
  `telephone1` varchar(20) default '',
  `telephone2` varchar(20) default '',
  `fax` varchar(20) default '',
  `email` varchar(100) default '',
  `website` varchar(100) default '',
  `description` varchar(255) default '',
  `openmonday` varchar(20) default '',
  `closemonday` varchar(20) default '',
  `opentuesday` varchar(20) default '',
  `closetuesday` varchar(20) default '',
  `openwednesday` varchar(20) default '',
  `closewednesday` varchar(20) default '',
  `openthursday` varchar(20) default '',
  `closethursday` varchar(20) default '',
  `openfriday` varchar(20) default '',
  `closefriday` varchar(20) default '',
  `opensaturday` varchar(20) default '',
  `closesaturday` varchar(20) default '',
  `opensunday` varchar(20) default '',
  `closesunday` varchar(20) default '',
  `opencloseinfo` varchar(255) default '',
  `storemanager` varchar(50) default '',
  `maplink` varchar(150) default '',
  `directions` varchar(255) default '',
  `recordstatus` varchar(20) default '',
  `recordlastmodified` timestamp NOT NULL default '0000-00-00 00:00:00',
  `recordlastmodifiedby` varchar(50) default '',
  `recordcreated` timestamp NOT NULL default '0000-00-00 00:00:00',
  `recordcreatedby` varchar(50) default '',
  PRIMARY KEY  (`storeID`)
);


DROP TABLE IF EXISTS `sluser`;
CREATE TABLE `sluser` (
  `userID` int(10) unsigned NOT NULL auto_increment,
  `username` varchar(50) default '',
  `password` varchar(50) default '',
  `userfullname` varchar(50) default '',
  `accesslevel` varchar(20) default '',
  `recordstatus` varchar(20) default '',
  `recordlastmodified` timestamp NOT NULL default '0000-00-00 00:00:00',
  `recordlastmodifiedby` varchar(50) default '',
  `recordcreated` timestamp NOT NULL default '0000-00-00 00:00:00',
  `recordcreatedby` varchar(50) default '',
  PRIMARY KEY  (`userID`)
);

but when I go to the page it doesnt appear to do anything - what am I doing wrong? Shouldn't there be more to the script than this?
 
Well the code you posted is not PHP. Looks to be just the DB script to create the tables.

You are supposed to feed this to the DB so it can recreate the tables it needs.

With that said, judging by the code your DB seems to be MYSQL
So perhaps posting in forum436 may be of more help.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top