Jump to content


Photo

Creating Table Problem


  • Please log in to reply
6 replies to this topic

#1 Trooper

Trooper
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 01 January 2004 - 07:50 PM

Okay I have this code that checks to see if a table exists...

[php:1:4304a899c6]<?php

if(mysql_list_tables($dbname) != news){
CREATE TABLE news ( //<-- This is were the error is
author VARCHAR(30) NOT NUUL,
dateposted DATETIME NOT NULL,
title VARCHAR(100) NOT NULL,
content CHAR(99999) NOT NULL,
) }
?>[/php:1:4304a899c6]

but when i go to the page i get this error...

Parse error: parse error, unexpected T_STRING in C:httpduserstrooperindex.php on line 21[/quote

?>[/code]
~Trooper

#2 shortkid422

shortkid422
  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 01 January 2004 - 08:06 PM

I think that the table needs to be in quotes.
[php:1:18aecfb026]<?php

if(mysql_list_tables($dbname) != news){
CREATE TABLE \'news\' (
author VARCHAR(30) NOT NUUL,
dateposted DATETIME NOT NULL,
title VARCHAR(100) NOT NULL,
content CHAR(99999) NOT NULL,
) }
?>[/php:1:18aecfb026]
Need some php work thats cheap and reliable?[br]AIM shortmonkey422[br]MSN shortkid422@hotmail.com[br]Email: shortkid422@hotmail.com

#3 Trooper

Trooper
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 01 January 2004 - 08:15 PM

Nope, didn\'t work
~Trooper

#4 Trooper

Trooper
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 02 January 2004 - 04:40 AM

so no ones gonna help me eh? I feel, lonly. :(
~Trooper

#5 SWI03

SWI03
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 02 January 2004 - 07:46 AM

NUUL is spelled wrong.. Null for the first instance of Null

cant you just use MYSQL-Front or something to put the sql statements in there to make the table. or don\'t you have access to the database?

#6 Trooper

Trooper
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 02 January 2004 - 06:47 PM

Well, I have phpmyadmin. I guess I could do that.
~Trooper

#7 SWI03

SWI03
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 02 January 2004 - 07:28 PM

well that will at least let ya know if it is your php syntax or sql ...

maybe it was just that crazy word nuul...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users