Jump to content

Creating Table Problem


Trooper

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]

Link to comment
https://forums.phpfreaks.com/topic/1591-creating-table-problem/
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]

Link to comment
https://forums.phpfreaks.com/topic/1591-creating-table-problem/#findComment-5207
Share on other sites

Archived

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

×
×
  • Create New...

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.