View Single Post
  #2 (permalink)  
Old 07-29-2007, 11:14 PM
rpgfan3233 rpgfan3233 is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jul 2007
Posts: 118
iTrader: (0)
rpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura aboutrpgfan3233 has a spectacular aura about
Try using the following:
PHP Code:
$result mysql_query($query) or die(mysql_error()); 
Note that mysql_error() is only for your benefit. You don't want that to actually be shown to users (and potential script kiddies and others with the intent to breach your security).

The "or die(mysql_error())" part simply says if mysql_query($query) returns FALSE (means there was an error), output whatever mysql_error() returns and then stop processing the page after that. Also, try this for your query:
PHP Code:
$query 'CREATE TABLE mycms ('.
         
'id INT NOT NULL AUTO_INCREMENT KEY'.
         
'username VARCHAR(10) NOT NULL, '.
         
'password VARCHAR(10) NOT NULL)'

__________________
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
-- Bjarne Stroustrup, creator of what is now known as C++
For more quotes by Bjarne Stroustrup, check out http://www.research.att.com/~bs/bs_faq.html#really-say-that.
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to rpgfan3233 For This Useful Post:
HelloWorld (07-29-2007)