You are here: Re: Build_DB PHP script « PHP Programming Language « IT news, forums, messages
Re: Build_DB PHP script

Posted by Angelos on 09/27/76 11:18

That is another piece of code :
************************************************
<?
ini_set('error_reporting', E_ALL);
ini_set("display_errors","1"); ?>
<?
require_once ('../../Connections/willans.php');

$create = 'CREATE DATABASE IF NOT EXISTS gamoto';
$results = mysql_query($create) or die (mysql_error());
mysql_select_db("gamoto");

$sql = '
DROP TABLE IF EXISTS cms_access_levels ;
CREATE TABLE IF NOT EXISTS cms_access_levels (
access_lvl int(10) unsigned NOT NULL auto_increment,
access_lvl_name varchar(45) NOT NULL ,
PRIMARY KEY ( access_lvl , access_lvl_name )
) TYPE=MyISAM;
';
$results = mysql_query($sql) or die (mysql_error());
if ($results)
echo "DB Created";
?>
******************************************************

And that is the 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 '; CREATE TABLE
IF NOT EXISTS cms_access_levels ( access_lv
##############################
For some reason it doesn't display the whole error ... but anyway that is
not the problem.

How am I going to make the $sql RUN ???

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация