Codes here !
Moderators: macek, egami, gesf
by xlordt » Sat Dec 14, 2002 11:22 pm
for some reason.. the table does not want to creat on the database.. can someone please help me and tell me what the hell am i doing wrong... thanx...
- Code: Select all
<?php
$db = mysql_connect("localhost","root","123456");
mysql_select_db("testing",$db);
$Query="
CREATE TABLE Members(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
username VARCHAR(30),
email VARCHAR(30))
";
mysql_close($db);
?>
can you please tell me what is going on.. thanx
-

xlordt
- New php-forum User

-
- Posts: 34
- Joined: Thu Dec 12, 2002 9:00 pm
- Location: NJ
-
by xlordt » Sun Dec 15, 2002 2:07 am
please disregard this post.. thanx.. i figured it out
-

xlordt
- New php-forum User

-
- Posts: 34
- Joined: Thu Dec 12, 2002 9:00 pm
- Location: NJ
-
by WiZARD » Sun Dec 15, 2002 2:56 am
Try do this:
- Code: Select all
<?php
$db = mysql_connect("localhost","root","123456");
mysql_select_db("testing",$db);
$result = mysql_query("CREATE TABLE Members(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
username VARCHAR(30),
email VARCHAR(30))")
or die("Invalid query: " . mysql_error());
?>
mysql_close($db);
?>
-

WiZARD
- Moderator

-
- Posts: 1257
- Joined: Thu Jun 20, 2002 10:14 pm
- Location: Ukraine, Crimea, Simferopol
-
Return to mySQL & php coding
Who is online
Users browsing this forum: No registered users and 1 guest