Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 28th, 2007, 09:33 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default cannot create one specific table using phpMyAdmin

I am using phpMyAdmin to upload my database to my server, but am running into some problems. It is mainly with one particular table, named "countries".

When i run the .SQL dump in phpMyAdmin I get the error:

Code:
CREATE TABLE `countries` (
`cityname` varchar( 100 ) default '',
`capital` varchar( 75 ) default '',
`shown` int( 1 ) default '0',
`countrycode` char( 2 ) default NULL ,
`provincecode` char( 2 ) default NULL ,
`provincename` varchar( 100 ) default '',
`provincecountrycode` char( 2 ) default NULL ,
`countryname` varchar( 100 ) default '',
`Geog_loc` varchar( 100 ) default NULL ,
`area` varchar( 5 ) default NULL ,
`nationality` varchar( 100 ) default NULL ,
KEY `countryname` ( `countryname` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

MySQL said: Documentation
#1046 - No database selected
Now this only seems to happen with this table as the dump executes fine when I take this out?

Also, when I have no records in the table on the server it gives me the following error when I do a PHP mysql_query() in my script:
Code:
SELECT command denied to user 'ayrshire_root'@'pass54.dizinc.com' for table 'countries'
This is the beginning of my MySQL dump (created with SQL Yog):
Code:
/*
SQLyog Community Edition- MySQL GUI v5.32
Host - 5.0.41-community-nt : Database - ayrshire_mini
*********************************************************************
Server version : 5.0.41-community-nt
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

create database if not exists `ayrshire_mini`;

USE `ayrshire_mini`;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

/*Table structure for table `countries` */

DROP TABLE IF EXISTS `countries`;

CREATE TABLE `countries` (
  `cityname` varchar(100) default '',
  `capital` varchar(75) default '',
  `shown` int(1) default '0',
  `countrycode` char(2) default NULL,
  `provincecode` char(2) default NULL,
  `provincename` varchar(100) default '',
  `provincecountrycode` char(2) default NULL,
  `countryname` varchar(100) default '',
  `Geog_loc` varchar(100) default NULL,
  `area` varchar(5) default NULL,
  `nationality` varchar(100) default NULL,
  KEY `countryname` (`countryname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

/*Data for the table `countries` */
Note: I changed the DEFAULT CHARSET from Latin to utf8 as I thought this might cause a problem.

Cheers,
Picco


www.crmpicco.co.uk
www.ie7.com
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
  #2 (permalink)  
Old November 3rd, 2007, 02:13 AM
Authorized User
 
Join Date: Nov 2004
Location: CHENNAI, TamilNadu, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tks_muthu
Default

CREATE TABLE `ayrshire_mini.countries` (
`cityname` varchar( 100 ) default '',
`capital` varchar( 75 ) default '',
`shown` int( 1 ) default '0',
`countrycode` char( 2 ) default NULL ,
`provincecode` char( 2 ) default NULL ,
`provincename` varchar( 100 ) default '',
`provincecountrycode` char( 2 ) default NULL ,
`countryname` varchar( 100 ) default '',
`Geog_loc` varchar( 100 ) default NULL ,
`area` varchar( 5 ) default NULL ,
`nationality` varchar( 100 ) default NULL ,
KEY `countryname` ( `countryname` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;


Muthu
  #3 (permalink)  
Old November 9th, 2007, 02:23 PM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

hi, thanks for that. not sure what you were getting at other than specifying the db name, but I caught the problem.......I was using MySQL extended inserts instead of just regular inserts and because it was 8000 rows it seemed to bring phpMyAdmin to a halt.

Changed over to regular inserts and it worked great

:-)

Ayrshire Minis - a Mini E-Community
www.ayrshireminis.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning Div over specific table cell pjmair HTML Code Clinic 4 May 8th, 2009 02:19 PM
Create generic XSL Template to create table Venkatachalapathy XSLT 5 March 11th, 2008 07:49 AM
Copy specific data in specific cells of sheet2 yogeshyl Excel VBA 1 May 14th, 2007 07:40 AM
Dynamic table on specific height of JSP page shoaibkhan2000 Pro JSP 0 August 1st, 2006 06:15 AM
Create table from another table using ADO Kaustav Pro VB Databases 0 October 15th, 2005 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.