473,394 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Mehere mySQL-Tabellen mit einem PHP-Befehl erstellen?

Hallo NG,

ich möchte mit einem install-script mehrere Tabellen erstellen und habe
es zum Testen mit dem Befehl "mysql_query" versucht. Eine Tabelle
erstellen funktioniert einwandfrei. Ab zwei bekomme ich eine
Fehlermeldung betreffend SQL-Syntax.

Mit phpMyAdmin ist es möglich das gesamte SQL-Script in einem einzigen
Formularfenster einzutippen und hochzuladen. Wo mache ich was falsch und
wie könnte eine Lösung aussehen?

Beispiele:
$creatab="
CREATE TABLE `MENUD` (
`MENUD_a` int(11) NOT NULL default '0',
`MENUD_pos` int(11) default '0',
`MENUD_name` varchar(250) default NULL,
PRIMARY KEY (`MENUD_a`)
) TYPE=MyISAM;

CREATE TABLE `MENUE` (
`MENUE_a` int(11) NOT NULL default '0',
`MENUE_pos` int(11) default '0',
`MENUE_name` varchar(250) default NULL,
PRIMARY KEY (`MENUE_a`)
) TYPE=MyISAM;

";
$result = mysql_query ($creatab)or die ("SQR ERROR: " . mysql_error());

Vielen Dank,
Hugo Balazs
Jul 17 '06 #1
1 2888
Hugo Balazs schrieb:
ich möchte mit einem install-script mehrere Tabellen erstellen und habe
es zum Testen mit dem Befehl "mysql_query" versucht. Eine Tabelle
erstellen funktioniert einwandfrei. Ab zwei bekomme ich eine
Fehlermeldung betreffend SQL-Syntax.
Hallo

....The mysql_query() function, used by this module, does not allow
multiple commands do be sent to the server...

Das ist mal meine letzte Info. PHPMyAdmin splittet das vorher soweit ich
weiß auf.

btw: Englische NG ;)

Florian
Jul 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Randell D. | last post by:
Folks, I have installed MySQL v4 (client, server and development rpm's). I've tried and failed to use the recommended mysqladmin to set a root password after the installation (I have another post...
0
by: mikey | last post by:
Hi all, I'm having great problems trying to install the latest MySQl RPM package onto my Red Hat Linux OS. There is already MySQL v 3.0 pre-installed with the RH Linux distribution disk but I...
0
by: Yun Guan | last post by:
Hello mysql gurus, I am trying to run perl on mysql database on Red Hat box. I want to install DBI and DBD:mysql using CPAN: perl -MCPAN -e shell cpan>install DBI The above succeeded, but...
3
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
0
by: Mark Adams | last post by:
I really need some help with this. MySQL will not start on boot despite everything I've done to make sure that it is set to do so. When I start it as root from a terminal with...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
by: Saqib Ali | last post by:
I installed mySQL and have it running.... but I think I made a mistake somewhere along the line...... I believe I did follow the instructions that were provided with the distribution at:...
2
by: trihanhcie | last post by:
I m currently working on a Unix server with a fedora 3 as an os My current version of mysql is 3.23.58. I'd like to upgrade the version to 5.0.18. After downloading from MYSQL.COM the package on...
1
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: ...
3
by: menzies | last post by:
Hi, I"m new to this forum, but I have been trying all day to install DBD::mysql onto my Intel MacBook. I've read lots of forums pages and none have gotten me to a successful 'make test' or a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
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...
0
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...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.