-
help! can't find the problem in php
PHP Code:
<?php
$server="localhost";
$user="kotrclan";
$pass="87kotr";
$flashbase ="kotrsite";
$table="match";
$hookup = mysql_connect($server, $user, $pass);
$debase=mysql_select_db($flashbase,$hookup);
$sql = "CREATE TABLE $table (cname char(100), csite char(100), cplayer char(100), ctype char(100), cmap char(100), cserver char(100), cround1 char(100), cround2 char(100), cfinal char(100), cwinner char(100), cssround1 char(100), cssround2 char(100), cdemoround1 char(100), cdemoround2 char(100))";
$result = mysql_query($sql,$hookup) or die("Tables not created.");
if ($result) {
echo "Tables have been created.";
}
?>
the password and everything is correct but yet i can't seem to create the table and fields, plz help. THX IN ADVANCE
Last edited by neo1487; 10-20-2002 at 07:35 PM.
-Neo
-
__OSX powered__
What does
"mysql_query($sql) or die(mysql_error())" give you??
-
Official FK nice guy and MOD
Hi,
think it would help to create a primary key for your table:
PHP Code:
<?php
$server="localhost";
$user="kotrclan";
$pass="87kotr";
$flashbase ="kotrsite";
$table="match";
$hookup = mysql_connect($server, $user, $pass);
$debase=mysql_select_db($flashbase,$hookup);
$sql = "CREATE TABLE $table (
cname char(100),
csite char(100),
cplayer char(100),
ctype char(100),
cmap char(100),
cserver char(100),
cround1 char(100),
cround2 char(100),
cfinal char(100),
cwinner char(100),
cssround1 char(100),
cssround2 char(100),
cdemoround1 char(100),
cdemoround2 char(100),
id int(4) DEFAULT '0' NOT NULL auto_increment,
PRIMARY KEY (id)
)";
$result = mysql_query($sql,$hookup) or die("Tables not created.");
if ($result) {
echo "Tables have been created.";
}
?>
Hope it helps..
3PRIMATES
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|