O2xygen 0 Report post Posted April 12, 2005 I look around the place, and at my own MYSQl scripts, and most look the same except with a few differing factors. Now Im relativly new to MYSQL, and not so new to PHP. The problem is though, I havent been able to test my scripts/site out so Im not sure if my scripts are right.For example, heres a script to create my user table. <?php$DBhost = "localhost"; $DBuser = "********"; $DBpass = "*********"; $DBName = "*********"; $connection = @mysql_connect($DBhost,$DBuser,$DBpass); echo "SQL Connection"; mysql_select_db("$DBName") or die("Unable to select database $DBName" . mysql_error() );?><?php$sql = "create table users(' 'ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . 'dob_day TINYINTUNSIGNED,'. 'dob_month TINYINTUNSIGNED,'. 'dob_year TINYINTUNSIGNED,'. 'quote text,'. 'namefirst char(20),'. 'namelast char(20),'. 'email char(255),'. 'username char(255),'. 'minitar char(255),'. 'password char(255),'.)";mysql_query($sql)$result = mysql_query($sql) or die("Login Query Failed." . mysql_error() . " ". $sql);?><html><head><title>Table created</title></head><body><p>DONE!</p></body></html> and when I compare this to others, some things differ, like the 'ID INT UNSIGNED' bit has underscores instead of spaces and is in lower case.So my question is, does these differing factors matter?Oh, by the way, Im new so Hi everyone Share this post Link to post Share on other sites
FaLgoR 0 Report post Posted April 12, 2005 You missed the ; here: ... 'username char(255),'. 'minitar char(255),'. 'password char(255),'.)"; mysql_query($sql) $result = mysql_query($sql) or die("Login Query Failed." . mysql_error() . " ". $sql); ... Share this post Link to post Share on other sites
bjrn 0 Report post Posted April 14, 2005 I look around the place, and at my own MYSQl scripts, and most look the same except with a few differing factors. <snip> and when I compare this to others, some things differ, like the 'ID INT UNSIGNED' bit has underscores instead of spaces and is in lower case. So my question is, does these differing factors matter? Oh, by the way, Im new so Hi everyone 71164[/snapback] I know that in some database systems upper/lowercase is important (like Oracle), but I don't think uppercase/lowercase is important in MySQL. However, I would think that there is a big difference between "ID INT UNSIGNED" and "ID_INT_UNSIGNED", the second one would just be one huge field name, and probably give off a syntax error because you didn't specify a type. So, upper/lowercase probably doesn't matter (in MySQL), but don't exchange underscores for spaces. And Hi. Welcome to Xisto. Share this post Link to post Share on other sites