hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : A small problem guys about the syntax PLZ
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

A small problem guys about the syntax PLZ

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-31-2005, 01:39 AM
freeboy1 freeboy1 is offline
WHT Addict
 
Join Date: Jan 2005
Posts: 129

A small problem guys about the syntax PLZ


Hi guys
i have a problem with a php script , i am trying to install it and it gives me this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'eccaone_list' at line 1

check the link:
http://www.eccao.net/maillist/create.php


this is the creat.php file

<?php
include("connect.php");

$link = "eccaone_list";
$res = mysql_query($link) or die(mysql_error());

mysql_select_db("eccaone_list");

$link = "
CREATE TABLE `newsletters` (
`name` text NOT NULL,
`content` text NOT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;";
$res = mysql_query($link) or die(mysql_error());

$link = "
CREATE TABLE `users` (
`name` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`date` text NOT NULL,
`status` text NOT NULL,
`unsubscribed` text NOT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;";
$res = mysql_query($link) or die(mysql_error());

if ($res)
die("<p>Succesfully made database. Please delete this file for security reasons.</p>");
?>

Reply With Quote


Sponsored Links
  #2  
Old 10-31-2005, 01:44 AM
dollar dollar is offline
Retired Moderator
 
Join Date: Sep 2004
Location: Flint, Michigan
Posts: 5,768
Well the problem is that you are trying to run a query:

PHP Code:
$link "eccaone_list";
$res mysql_query($link) or die(mysql_error()); 
When I think you mean to run a mysql_connect

Maybe:

PHP Code:

// Connect to the database
$link mysql_connect('localhost''mysql_user''mysql_password');
if (!
$link) {
   die(
'Could not connect: ' mysql_error());
}

//Select the database
mysql_select_db("eccaone_list");

// Create a query
$q "
CREATE TABLE `newsletters` (
`name` text NOT NULL,
`content` text NOT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;"
;

//Run the query
$res mysql_query($q) or die(mysql_error());

//Create another query
$q "
CREATE TABLE `users` (
`name` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`date` text NOT NULL,
`status` text NOT NULL,
`unsubscribed` text NOT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;"
;

//Run the second query
$res mysql_query($q) or die(mysql_error());


if (
$res)
die(
"<p>Succesfully made database. Please delete this file for security reasons.</p>"); 

__________________
Mike from Zoodia.com
Professional web design and development services.
In need of a fresh hosting design? See what premade designs we have in stock!
Web design tips, tricks, and more at MichaelPruitt.com

Reply With Quote
  #3  
Old 10-31-2005, 03:20 AM
Burhan Burhan is offline
Community Guide
 
Join Date: Jul 2003
Location: Kuwait
Posts: 5,100
Just delete these two lines:

$link = "eccaone_list";
$res = mysql_query($link) or die(mysql_error());

And it should work.

__________________
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Serguei Beloussov Shares his Vision for the Future in Parallels Summit Keynote Web Hosting News 2013-02-06 20:22:52
Yottaa Partners to Offer Ecommerce Acceleration for Drupal Online Merchants Web Hosting News 2012-11-06 08:58:19
Web Hosting Vet Nick Nelson Launches Beta of New Website Backup Tool Comcure Web Hosting News 2012-05-22 09:51:28
BaseKit Website Builder Partnership Signals Growing South African Market Web Hosting News 2012-04-30 16:34:19
Web Host SKGOLD Adds Free CloudFlare Security to Web Hosting Plans Web Hosting News 2011-12-08 19:07:03


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?