Please help... I a completely new to PHP and mysql. I am using PHPmagic to construct a web database for community use events etc... when I generate the code and place on the website it doesn't want to work. Below is the error I recieve when accessing page: http://www.csweb.net/php_test/setup/setup.php
As I understand it this is the page created to setup the database for mysql. Anyway, any thoughts or help would be greatly appreciated.
The error is:
Parse error: syntax error, unexpected T_STRING in D:\csweb\PHP_test\setup\setup.php on line 3
Here is the code generated by phpmagic
<?php
error reporting(E_ALL ^ E_NOTICE);
// This script and data application were generated by PHPMagic 1.1 on 4/29/2005 at 1:42:00 AM
// Download PHPMagic for free from http://www.websitedatabases.com/
include("../language.php");
include("./lib.php");
if(!@mysql_connect("localhost", "root", "xxxx"))
{
echo $Translation["error while connecting to mysql:"] . mysql_error();
exit;
}
echo str_replace("<DBName>", "RSOD", $Translation["attempting to create db"]) . "<br>";
if(!@("create database if not exists RSOD"))
{
echo $Translation["error while creating db"] . mysql_error();
echo "<br>" . str_replace("<DBName>", "RSOD", $Translation["please make sure username has permissions"]);
}
mysql_close();
echo "Done ... <br>";
// create table 'table1'
echo str_replace("<TableName>", "table1", $Translation["attempting to create table"]);
sql("create table if not exists table1 ( field1 TEXT primary key, field2 MEDIUMBLOB , field3 TEXT , field4 INT )");
echo $Translation["done"] . "<br>";
echo "<br>" . $Translation["finished setup"] . "<br>";
echo $Translation["to access your db"];
?>