Jump to content

Archived

This topic is now archived and is closed to further replies.

Trooper

Creating Table Problem

Recommended Posts

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]

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

 

maybe it was just that crazy word nuul...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.