Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

table

Codes here !

Moderators: macek, egami, gesf

table

Postby 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
User avatar
xlordt
New php-forum User
New php-forum User
 
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

Postby xlordt » Sun Dec 15, 2002 2:07 am

please disregard this post.. thanx.. i figured it out
User avatar
xlordt
New php-forum User
New php-forum User
 
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

Re: table

Postby 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);
?>
User avatar
WiZARD
Moderator
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 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron