Hey guys! I need HELP ASAP PLEASE!
For my Database Design & Implementation assignment, I've been told to use MSSQL
to create a database for a prison equipment and accesories shopping site.
Here is the link:
http://www.pxdirect.com/
I'm already having trouble with INSERT function.......here is my code below:
CREATE TABLE tblcust_address0608307 (
custID varchar,
address varchar (50) NOT NULL,
address2 varchar (50) NOT NULL,
County varchar (20) NOT NULL,
Postcode varchar (8) NOT NULL,
PRIMARY KEY (custID)
)
INSERT INTO tblcust_address0608307 VALUES
( 'SD113', 'The Dukes', 'London Road', 'Essex', 'SS17 8PH' )
INSERT INTO tblcust_address0608307 VALUES
( 'DD454', 'The Oaks', 'Blackshots Road', 'Essex', 'RM17 8PH' )
INSERT INTO tblcust_address0608307 VALUES
( 'PD101', '101', 'Walton Courts', 'Essex', 'CO17 1PG' )
INSERT INTO tblcust_address0608307 VALUES
( 'MD901', '4', 'Springfield Avenue', 'Essex', 'CM7 6OP' )
INSERT INTO tblcust_address0608307 VALUES
( 'SD119', '4', 'Springfield Avenue', 'Essex', 'CM7 6OP' )
AND I'M GETTING THIS STUPID MESSAGE ALL THE TIME:
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
COULD YOU PLEASE HELP! IS THERE ANY WAY TO RESOLVE THIS?
Thanks and much appreciated!
Sho
MSSQL HELP!
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
Page 1 of 1
MSSQL HELP!
#2
Posted 12 December 2007 - 02:06 PM
sho88, on Dec 12 2007, 05:12 PM, said:
Hey guys! I need HELP ASAP PLEASE!
For my Database Design & Implementation assignment, I've been told to use MSSQL
to create a database for a prison equipment and accesories shopping site.
Here is the link:
http://www.pxdirect.com/
I'm already having trouble with INSERT function.......here is my code below:
CREATE TABLE tblcust_address0608307 (
custID varchar,
address varchar (50) NOT NULL,
address2 varchar (50) NOT NULL,
County varchar (20) NOT NULL,
Postcode varchar (8) NOT NULL,
PRIMARY KEY (custID)
)
INSERT INTO tblcust_address0608307 VALUES
( 'SD113', 'The Dukes', 'London Road', 'Essex', 'SS17 8PH' )
INSERT INTO tblcust_address0608307 VALUES
( 'DD454', 'The Oaks', 'Blackshots Road', 'Essex', 'RM17 8PH' )
INSERT INTO tblcust_address0608307 VALUES
( 'PD101', '101', 'Walton Courts', 'Essex', 'CO17 1PG' )
INSERT INTO tblcust_address0608307 VALUES
( 'MD901', '4', 'Springfield Avenue', 'Essex', 'CM7 6OP' )
INSERT INTO tblcust_address0608307 VALUES
( 'SD119', '4', 'Springfield Avenue', 'Essex', 'CM7 6OP' )
AND I'M GETTING THIS STUPID MESSAGE ALL THE TIME:
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
COULD YOU PLEASE HELP! IS THERE ANY WAY TO RESOLVE THIS?
Thanks and much appreciated!
Sho
For my Database Design & Implementation assignment, I've been told to use MSSQL
to create a database for a prison equipment and accesories shopping site.
Here is the link:
http://www.pxdirect.com/
I'm already having trouble with INSERT function.......here is my code below:
CREATE TABLE tblcust_address0608307 (
custID varchar,
address varchar (50) NOT NULL,
address2 varchar (50) NOT NULL,
County varchar (20) NOT NULL,
Postcode varchar (8) NOT NULL,
PRIMARY KEY (custID)
)
INSERT INTO tblcust_address0608307 VALUES
( 'SD113', 'The Dukes', 'London Road', 'Essex', 'SS17 8PH' )
INSERT INTO tblcust_address0608307 VALUES
( 'DD454', 'The Oaks', 'Blackshots Road', 'Essex', 'RM17 8PH' )
INSERT INTO tblcust_address0608307 VALUES
( 'PD101', '101', 'Walton Courts', 'Essex', 'CO17 1PG' )
INSERT INTO tblcust_address0608307 VALUES
( 'MD901', '4', 'Springfield Avenue', 'Essex', 'CM7 6OP' )
INSERT INTO tblcust_address0608307 VALUES
( 'SD119', '4', 'Springfield Avenue', 'Essex', 'CM7 6OP' )
AND I'M GETTING THIS STUPID MESSAGE ALL THE TIME:
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.
COULD YOU PLEASE HELP! IS THERE ANY WAY TO RESOLVE THIS?
Thanks and much appreciated!
Sho
Perhaps you could try setting a size for custID, it looks like it should be a minimum of (5) characters.
#3
Posted 12 December 2007 - 02:12 PM
MSSQL? I thought you were writing the shopping cart in PHP?
#4
Posted 12 December 2007 - 04:22 PM
Is there a reason you didn't specify a size for the CustID field? I don't know what it defaults to but the message is saying you're trying to put data into a field that's smaller than the data.
#5
Posted 12 December 2007 - 06:50 PM
thanks guys! i'ma try it out on friday when i go to uni!
#6
Posted 12 December 2007 - 06:52 PM
sypher, on Dec 12 2007, 06:12 PM, said:
MSSQL? I thought you were writing the shopping cart in PHP? 
haha! thanks! well, i'm strugglin' a bit with that, and it's due next week friday!!
and this is what i was given to make a template of:
<?php
session_start();
if(!isset($_SESSION['cart'])) {
$_SESSION['cart']=array();
}
if (isset($_GET['empty'])) {
unset ($_SESSION['cart']);
header('location: ' . $_SERVER['PHP_SELF'].'?'.SID);
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Shopping Cart</title>
</head>
<body>
<h1> Your Shopping Cart </h1>
<?php
$items = array(
'Adults 06/07 short sleeved home shirt',
'Adults 06/07 short sleeved trainining shirt',
'Adults 06/07 long sleeved goalkeeper shirt name & number printed',
'Arsenal money saving pot',
'Arsenal crest key ring',
'Arsenal wallet');
$prices = array(39.99, 29.99, 49.99, 9.99, 3.99, 6.99);
?>
<table border="1">
<thead>
<tr>
<th> Item Description </th>
<th> Price </th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i<count($_SESSION['cart']); $i++) {
echo '<tr>';
echo '<td>'.$items[$_SESSION['cart'][$i]].'</td>';
echo "<td align = 'right'>£";
echo number_format($prices[$_SESSION['cart'][$i]], 2).'</td>';
echo '</tr>';
$total = $total + $prices[$_SESSION['cart'][$i]];
}
?>
</tbody>
<tfoot>
<tr>
<th align="right"> Total: </th><br />
<th align="right">£<?php echo number_format($total,2);?>
</th>
</tr>
</tfoot>
</table>
<p><a href="catalog.php">Continue Shopping</a> or
<a href="<?php echo $_SERVER['PHP_SELF'];?>?empty=1"> Empty Your Cart </a></p>
</body>
</html>
#7
Posted 12 January 2008 - 01:37 PM
Is there any particular reason you must use MSSQL? PHP5 and MySQL goes hand-in-hand. It would be best to use MySQL.
-(X)HTML, CSS, JavaScript, PHP, ASP.NET, Java, ColdFusion, XML, Python, SQL, Ruby, Flash, ActionScript 2.0
-My Website is www.gameyin.com
-Do not P.M. me on design details. I WILL, however, help you with code errors/problems. Thank you.
-My Website is www.gameyin.com
-Do not P.M. me on design details. I WILL, however, help you with code errors/problems. Thank you.
Share this topic:
Page 1 of 1


Help
This topic is locked

MultiQuote











