RE: FN-FORUM SQL Tables
date posted 11th September 2002 18:28
varchar(5000) for your properties info column definition exceeds the max
value of 255. Use a text or blob type instead.
Rich
-----Original Message-----
From: [EMAIL REMOVED]
[EMAIL REMOVED] Behalf Of Darren - Javelin
Designs
Sent: 11 September 2002 17:52
To: [EMAIL REMOVED]
Subject: RE: FN-FORUM SQL Tables
Some one suggested the below code, but that still only creates the user
table and not the properties table. Does anyone know what to do so I can
get this working.
-----Original Message-----
From: [EMAIL REMOVED]
[EMAIL REMOVED] On Behalf Of Rich Bradshaw
Sent: 11 September 2002 01:51
To: [EMAIL REMOVED]
Subject: Re: FN-FORUM SQL Tables
Try this...
include("vars.php");
//Create the MySQL Database.
$result = mysql_create_db ("$db_name");
if ($result == false)
echo mysql_errno() . ": " . mysql_error() . "";
//Connect To The New Database
$connection = mysql_connect ("localhost", "darren", "pass");
if ($connection == false)
{
echo mysql_errno().": ".mysql_error()."";
exit;
}
// Select the DB
$result = mysql_select_db("$db_name");
//Create The User Table
$query = "create table users " ."(id INT NOT NULL AUTO_INCREMENT,
username
varchar(50), password varchar(50), name varchar(50), email varchar(50),
type
varchar(10), PRIMARY KEY (id))";
// Execute the query
mysql_query("$query");
// Check the result
if ($result)
echo "The users table was successfully created!";
else
echo mysql_errno().": ".mysql_error()."";
//Create The Properties Table
$query = "create table properties " ."(id INT NOT NULL AUTO_INCREMENT,
thumbnail varchar(50), location varchar(50), price varchar(10), address
varchar(100), img1 varchar(50), img2 varchar(50), img3 varchar(50), img4
varchar(50), info varchar(5000), PRIMARY KEY (id))";
// Execute the query
mysql_query("$query");
// Check the result
if ($result)
echo "The properties table was successfully created!";
else
echo mysql_errno().": ".mysql_error()."";
// Disconnect from the DB
mysql_close ();
Cheers,
Rich
----- Original Message -----
From: Darren - Javelin Designs
To: [EMAIL REMOVED]
Sent: Tuesday, September 10, 2002 10:52 PM
Subject: FN-FORUM SQL Tables
Hi if you have a look at this script, below the first $query I have
another
but as a comment. What I would like to know is how can I add that
comment
to the php script so it also creates that table, as I have tried all I
can.
============================================================
= Advanced web hosting solutions from Saffas. =
= Unix, PHP, mySQL, SSL, Perl, Control Panel, 24/7 access. =
= Why pay more for less? http://www.saffas.com =
============================================================
Sponsor the forum for as little as £1 at:
http://www.freelancers.net/cgi/sponsor.cgi?action=show
Advertise with Freelancers.net +Additions+
http://www.freelancers.net/advert.php
Freelancers and Freelance Jobs:
http://www.freelancers.net
Forum FAQs:
http://freelancers.netrickery.com
To unsubscribe please email:
[EMAIL REMOVED]
If you have difficulties unsubscribing please email:
[EMAIL REMOVED]
============================================================
= Advanced web hosting solutions from Saffas. =
= Unix, PHP, mySQL, SSL, Perl, Control Panel, 24/7 access. =
= Why pay more for less? http://www.saffas.com =
============================================================
Sponsor the forum for as little as £1 at:
http://www.freelancers.net/cgi/sponsor.cgi?action=show
Advertise with Freelancers.net +Additions+
http://www.freelancers.net/advert.php
Freelancers and Freelance Jobs:
http://www.freelancers.net
Forum FAQs:
http://freelancers.netrickery.com
To unsubscribe please email:
[EMAIL REMOVED]
If you have difficulties unsubscribing please email:
[EMAIL REMOVED]