Avatar billede jorn1 Nybegynder
08. november 2005 - 03:21 Der er 1 kommentar og
1 løsning

fejl i mysql tabel

Er der en der kan se hvad der er galt her
første tabel $dbtable bliver ikke createt til databaseb
men $smilietable bliver createt i dadabasen

?????
if(!isset($functions)){
include("functions.php"); 
}

dbconnect();

# --------------------------------------------------------
#
# Create table $dbtable
#

mysql_query("DROP TABLE IF EXISTS $dbtable");


$done1=mysql_query("
CREATE TABLE $dbtable(
gid int(11) NOT NULL auto_increment PRIMARY KEY,
name varchar (200) NOT NULL,
email varchar(100) default NULL,
icq int(16) default NULL,
yahoo varchar(30) default NULL,
aim varchar(20) default NULL,
location varchar(25) default NULL,
url varchar(100) default NULL,
comments text NOT NULL,
date varchar (100) NOT NULL,
private int(1) NOT NULL default '0',
ip varchar(40) default NULL,
timestamp int(18) default NULL)");

if($done1){
    echo"Table $dbtable created<br />";
}else{
    echo"table not done<br />";
}

$done2=mysql_query("INSERT INTO $dbtable (gid, name, email, icq, yahoo, aim, location, url, comments, date, private, ip,timestamp) VALUES ('', 'Eddie', 'eddies@eddiecentral.net',91579749,'eddiembabaali','EddieLeroy','USA', 'www.eddiecentral.net', 'Nice site here','$todaysdate','','','')");

if($done2){
    echo"Table populated";
}else{
    echo"table not populated<br />";
}

mysql_query("DROP TABLE IF EXISTS $smilietable");

mysql_query("
CREATE TABLE $smilietable (
  smiliecode char(3) NOT NULL,
  image varchar(15) NOT NULL,
  name varchar(25) NOT NULL
) TYPE=MyISAM") or die ("ERROR : Could not create table $smilietable");
echo "<b>$smilietable table created</b>...<br>";

mysql_query("INSERT INTO $smilietable VALUES ( ':)', 'smile.gif', 'Smile')");
mysql_query("INSERT INTO $smilietable VALUES ( ':-)', 'smile.gif', 'Smile')");
mysql_query("INSERT INTO $smilietable VALUES ( ':lo', 'looney.gif', 'Looney')");
mysql_query("INSERT INTO $smilietable VALUES ( ':pi', 'pimp.gif', 'Pimp')");
mysql_query("INSERT INTO $smilietable VALUES ( ':fy', 'mfinger.gif', 'Monkey Bird')");
mysql_query("INSERT INTO $smilietable VALUES ( ':pu', 'pukeface.gif', 'Puke')");
mysql_query("INSERT INTO $smilietable VALUES ( ':no', 'no.gif', 'NO!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ro', 'rosie.gif', 'Rosy Cheeks')");
mysql_query("INSERT INTO $smilietable VALUES ( ':sh', 'shudder.gif', 'Shudder')");
mysql_query("INSERT INTO $smilietable VALUES ( ':si', 'sick.gif', 'Sick')");
mysql_query("INSERT INTO $smilietable VALUES ( ':sm', 'smoker.gif', 'Smokin')");
mysql_query("INSERT INTO $smilietable VALUES ( ':se', 'sperm.gif', 'Sperm')");
mysql_query("INSERT INTO $smilietable VALUES ( ':))', 'lol.gif', 'LOL')");
mysql_query("INSERT INTO $smilietable VALUES ( ';)', 'wink.gif', 'Winkywinky')");
mysql_query("INSERT INTO $smilietable VALUES ( ':(', 'frown.gif', 'Frown')");
mysql_query("INSERT INTO $smilietable VALUES ( ':-(', 'frown.gif', 'Frown')");
mysql_query("INSERT INTO $smilietable VALUES ( ':[', 'mad.gif', 'Mad')");
mysql_query("INSERT INTO $smilietable VALUES ( ':&)', 'clown.gif', 'Clown')");
mysql_query("INSERT INTO $smilietable VALUES ( ':?)', 'confused.gif', 'Confused')");
mysql_query("INSERT INTO $smilietable VALUES ( ':c)', 'cool.gif', 'Cooool')");
mysql_query("INSERT INTO $smilietable VALUES ( ':e)', 'eek.gif', 'Eeeeek')");
mysql_query("INSERT INTO $smilietable VALUES ( ':f)', 'flash.gif', 'Flash')");
mysql_query("INSERT INTO $smilietable VALUES ( ':g)', 'girl.gif', 'Girl')");
mysql_query("INSERT INTO $smilietable VALUES ( ':i)', 'idee.gif', 'Idea')");
mysql_query("INSERT INTO $smilietable VALUES ( ':r)', 'redface.gif', 'Redface')");
mysql_query("INSERT INTO $smilietable VALUES ( ':8)', 'rolleyes.gif', 'RollEyes')");
mysql_query("INSERT INTO $smilietable VALUES ( ':}', 'tongue.gif', 'Tongue')");
mysql_query("INSERT INTO $smilietable VALUES ( ':t)', 'tasty.gif', 'Tasty')");
mysql_query("INSERT INTO $smilietable VALUES ( ':1)', 'alien2.gif', 'invader')");
mysql_query("INSERT INTO $smilietable VALUES ( ':2)', 'kitty.gif', 'Bastard Kitty')");
mysql_query("INSERT INTO $smilietable VALUES ( ':z)', 'grazy.gif', 'Grazy')");
mysql_query("INSERT INTO $smilietable VALUES ( ':y)', 'crying.gif', 'Crying')");
mysql_query("INSERT INTO $smilietable VALUES ( ':o)', 'sleepy.gif', 'Sleepy')");
mysql_query("INSERT INTO $smilietable VALUES ( ':a)', 'alien.gif', 'Alien')");
mysql_query("INSERT INTO $smilietable VALUES ( ':s)', 'smokie.gif', 'Smokie')");
mysql_query("INSERT INTO $smilietable VALUES ( ':l)', 'love.gif', 'Loooove')");
mysql_query("INSERT INTO $smilietable VALUES ( ':L)', 'love2.gif', 'Looove')");
mysql_query("INSERT INTO $smilietable VALUES ( ':]', 'biggrin.gif', 'Big Smile')");
mysql_query("INSERT INTO $smilietable VALUES ( ':-/', 'bounce.gif', 'Bounce')");
mysql_query("INSERT INTO $smilietable VALUES ( ':b)', 'burnout.gif', 'Burnout')");
mysql_query("INSERT INTO $smilietable VALUES ( ':3)', 'heart.gif', 'Heart1')");
mysql_query("INSERT INTO $smilietable VALUES ( ':4)', 'rainbow.gif', 'tie died')");
mysql_query("INSERT INTO $smilietable VALUES ( ':5)', 'el.gif', 'Embarrassed')");
mysql_query("INSERT INTO $smilietable VALUES ( ':6)', 'pumpkin2.gif', 'Helloween')");
mysql_query("INSERT INTO $smilietable VALUES ( ':7)', 'private.gif', 'Secret')");
mysql_query("INSERT INTO $smilietable VALUES ( ':x)', 'xmas.gif', 'Christmas')");
mysql_query("INSERT INTO $smilietable VALUES ( ':9)', 'kiss.gif', 'Kiss, Kiss')");
mysql_query("INSERT INTO $smilietable VALUES ( ':1]', 'karate.gif', 'Karate')");
mysql_query("INSERT INTO $smilietable VALUES ( ':2]', 'cold.gif', 'Cold')");
mysql_query("INSERT INTO $smilietable VALUES ( ':3]', 'devil.gif', 'Devil')");
mysql_query("INSERT INTO $smilietable VALUES ( ':4]', 'tongue2.gif', 'So Nyah!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':5]', 'redhot.gif', 'Red Hot')");
mysql_query("INSERT INTO $smilietable VALUES ( ':6]', 'smash.gif', 'Smash!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':7]', 'frosty.gif', 'Frosty')");
mysql_query("INSERT INTO $smilietable VALUES ( ':8]', 'confused2.gif', 'Confused again')");
mysql_query("INSERT INTO $smilietable VALUES ( ':9]', 'kaioken.gif', 'KAI')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ca', 'cat.gif', 'Kitty')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ce', 'censored.gif', 'Censor')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ch', 'cheers.gif', 'Cheers')");
mysql_query("INSERT INTO $smilietable VALUES ( ':co', 'cowboy.gif', 'Cowboy')");
mysql_query("INSERT INTO $smilietable VALUES ( ':da', 'dance.gif', 'Dancing')");
mysql_query("INSERT INTO $smilietable VALUES ( ':gr', 'dance1.gif', 'Dancing Stick')");
mysql_query("INSERT INTO $smilietable VALUES ( ':du', 'dunce.gif', 'Dunce')");
mysql_query("INSERT INTO $smilietable VALUES ( ':fi', 'finger.gif', 'Bird')");
mysql_query("INSERT INTO $smilietable VALUES ( ':fe', 'flame.gif', 'Flame')");
mysql_query("INSERT INTO $smilietable VALUES ( ':fg', 'flaming.gif', 'Flaming')");
mysql_query("INSERT INTO $smilietable VALUES ( ':fl', 'flower2.gif', 'Flower2')");
mysql_query("INSERT INTO $smilietable VALUES ( ':1}', 'vampire.gif', 'Vampire')");
mysql_query("INSERT INTO $smilietable VALUES ( ':2}', 'splat.gif', 'Splat')");
mysql_query("INSERT INTO $smilietable VALUES ( ':3}', 'rwb.gif', 'Flag Smiley')");
mysql_query("INSERT INTO $smilietable VALUES ( ':4}', 'FRlol.gif', 'LOL2')");
mysql_query("INSERT INTO $smilietable VALUES ( ':5}', 'goodbad.gif', 'Good / Bad')");
mysql_query("INSERT INTO $smilietable VALUES ( ':6}', 'eek2.gif', 'EEEEK')");
mysql_query("INSERT INTO $smilietable VALUES ( ':7}', 'dodgy.gif', 'Dodgy')");
mysql_query("INSERT INTO $smilietable VALUES ( ':8}', 'bawling.gif', 'Bawling')");
mysql_query("INSERT INTO $smilietable VALUES ( ':9}', 'party.gif', 'Party on, Garth!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ni', 'nighty.gif', 'Nightey, Night!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':wa', 'wavey.gif', 'Wave!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':pa', 'patty.gif', 'Patty')");
mysql_query("INSERT INTO $smilietable VALUES ( ':al', 'alarm.gif', 'Alarm')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ba', 'barf.gif', 'Barf!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':bd', 'birthday.gif', 'Birthday')");
mysql_query("INSERT INTO $smilietable VALUES ( ':bu', 'bubble.gif', 'bubble')");
mysql_query("INSERT INTO $smilietable VALUES ( ':hi', 'hippie.gif', 'Hippie')");
mysql_query("INSERT INTO $smilietable VALUES ( ':jo', 'joker.gif', 'Jester')");
mysql_query("INSERT INTO $smilietable VALUES ( ':kn', 'knight.gif', 'Knight')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ko', 'koolaid.gif', 'KoolAid')");
mysql_query("INSERT INTO $smilietable VALUES ( ':to', 'tomato.gif', 'tomato')");
mysql_query("INSERT INTO $smilietable VALUES ( ':tu', 'tut.gif', 'King Tut')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ty', 'type.gif', 'Typing')");
mysql_query("INSERT INTO $smilietable VALUES ( ':wh', 'whip.gif', 'Whip It!')");
mysql_query("INSERT INTO $smilietable VALUES ( ':ja', 'whoa.gif', 'Jaw Dropping')");
echo "$smilietable table populated...<br />";
Avatar billede bromer Nybegynder
08. november 2005 - 09:55 #1
SQL'en er sådan set fin nok. Er du sikker på du har en værdi i variablen $dbtable?
Avatar billede jorn1 Nybegynder
10. november 2005 - 04:16 #2
har fundet min fejl det var ikke i mysql tabelen
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester