I have this:
$mysql_link = mysql_connect($hostname, $username, $password);
mysql_select_db($databasename);
$create = "CREATE TABLE 'photosgigs' ('id' INT(4) NOT NULL AUTO_INCREMENT,
'table_gal' VARCHAR(100) NOT NULL, 'gallery' VARCHAR(100) NOT NULL, PRIMARY
KEY ('id'))";
mysql_query($create,$mysql_link) or die(failed);
with $hostname, $username & $password set.
This won't create a table, can you give me any ideas y?
Thanks
--
Kathryn (Fire Juggler) http://www.firejugglers.34sp.com http://www.cornwalljugglers.co.uk 2 1215
>$mysql_link = mysql_connect($hostname, $username, $password); mysql_select_db($databasename); $create = "CREATE TABLE 'photosgigs' ('id' INT(4) NOT NULL AUTO_INCREMENT, 'table_gal' VARCHAR(100) NOT NULL, 'gallery' VARCHAR(100) NOT NULL, PRIMARY KEY ('id'))"; mysql_query($create,$mysql_link) or die(failed);
with $hostname, $username & $password set.
This won't create a table, can you give me any ideas y?
Use print mysql_error() to find out why.
My guess is that the quotes should be backquotes. Look at the error
message to be sure. You also might not have sufficient privileges
to create tables.
Gordon L. Burditt
Fire Juggler wrote: I have this: $mysql_link = mysql_connect($hostname, $username, $password); mysql_select_db($databasename); $create = "CREATE TABLE 'photosgigs' ('id' INT(4) NOT NULL AUTO_INCREMENT, 'table_gal' VARCHAR(100) NOT NULL, 'gallery' VARCHAR(100) NOT NULL, PRIMARY KEY ('id'))"; mysql_query($create,$mysql_link) or die(failed);
Giving you have sufficient privileges to create the table, I'd
completely remove the single quotes.
I think you also need to provide default values for both table_gal
and gallery since you are declaring them "not null".
/Marcin This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Joshua Beall |
last post by:
Hi All,
I am working on a registration system, and one of the things I am going to
need to be able to do it setup the database tables for each event that I
have registration for. Normally I...
|
by: Michael Iatauro |
last post by:
I've been having a little trouble creating users cross-platform. I have
a little script that works just fine on Solaris 8 using this command:
eval "/path/to/mysql --user=root --password=*****...
|
by: azamka |
last post by:
Hi everyone,
I am trying to create tables with type innodb. I created a database and all
the tables of type ISAM. Now I am at the point of making relations and
establish refrential integrity....
|
by: David Heller |
last post by:
I have this schema I exported from a database running mysql version 4.01
I'm trying to create this table on a server running mysql 3.23
I keep getting a syntax error near line 11 (I added the line...
|
by: Ian Davies |
last post by:
I have created a database with about 17 tables. I have been creating foreign
keys some of which have worked but when creating others I get the message
below
*************************
1005...
|
by: Motoma |
last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/.
Introduction:...
|
by: Thufir |
last post by:
I'm working from <http://www.oracle.com/technology/pub/articles/haefel-
oracle-ruby.html>, would like to adapt the SQL for MySQL, please. Yes, I
know, that's oracle wheras I'm using MySQL. This...
|
by: mramsay |
last post by:
Hi,
I'm having a real problem creating a dynamic hyperlink for my website.
I want to pull the field name from mysql table. Field name is description.
I would like this to be a hyperlink on my...
|
by: AmiMitra |
last post by:
i am using mysql 5.1. i have one table named as resv_record. the format is
create table resv_record ( book enum('h','c','r','f','t') , resv_id int(8) auto_increment not null , user_id varchar(12)...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |