mysql / php problem :S

A

Anonymous

Guest
I really need help!!!

Code:
<?
include "connect.php";

$createusers="CREATE TABLE Usersklklk (
  id bigint(21) NOT NULL default '0',
  Username varchar(60) NOT NULL default '',
  Password varchar(255) NOT NULL default '',
  monsterName varchar(60) NOT NULL default '',
  monsterType varchar(60) NOT NULL default '',
  lvl bigint(21) NOT NULL default '',
  atk bigint(21) NOT NULL default '',
  def bigint(21) NOT NULL default '',
  spd bigint(21) NOT NULL default '',
  int bigint(21) NOT NULL default '',
  hp bigint(21) NOT NULL default '',
  IP bigint(21) NOT NULL default '',
  buddylist longtext NOT NULL default '',
  wins bigint(21) NOT NULL default '',
  ties bigint(21) NOT NULL default '',
  loses bigint(21) NOT NULL default '',
  messages longtext NOT NULL default '',
  email varchar(60) NOT NULL default '',
  items longtext NOT NULL default '',
  equipment longtext NOT NULL default '' 
)";


mysql_query($createusers) or die(mysql_error());
print "Installation Complete";
?>

when i run that i get:
Code:
You have an error in your SQL syntax near 'int bigint(21) NOT NULL default '', hp bigint(21) NOT NULL default '', IP ' at line 11
seriously!!! need help! :shock:
 
Well, i think the problem is because you´re giving to your field the name int, witch is the same as Mysql field´s type!

You better give it another name :p


Cheers,
gesf
 
Thx:p

one more question:
Code:
<?php
include "connect.php";
$limit=100;
$getss=("SELECT * FROM sams_shout ORDER by id DESC LIMIT $limit");
while($shout=mysql_fetch_array($getss)){
extract($shout);
i get:
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /customers/n1studios.net/n1studios.net/httpd.www/sams_shout/shouts.php on line 5
wtf is wrong with line 5 ???
 
Yeh, you miss something on line: 4!
You need to 'run' the query before 'fetching' it!

Use this instead:
Code:
$getss = mysql_query("SELECT * FROM sams_shout ORDER by id DESC LIMIT $limit");
 
Back
Top