OK to change the text type length I had to use..
sp_tableoption N'MyTable', 'text in row', 'ON'
sp_tableoption N'MyTable', 'text in row', '7000'
Here's my code to query the Database...
// 1) Get all Investment Types
$query = "SELECT investment_type_ID, investment_type, inv_note, inv_note2 ".
"FROM investment_type";
$result = mssql_query($query) or die('Select Error');
$type_array = array();
$type1_array = array();
$id_array = array();
while($row = mssql_fetch_assoc($result))
{
// option string
$option .= '<option value="'.$row['investment_type_ID'].'">'.$row['investment_type'].'</option>';
// arrays to build javascript array string
$type1_array[] = $row['inv_note2'];
$type_array[] = $row['inv_note']; //addslashes for javascript escape
$id_array[] = $row['investment_type_ID'];
}// end while
//create string for javascript assoc array format. "key1:value1", "key2:value2", ........
for($i=0; $i < sizeof($id_array); $i++)
{
$javascript_array[$i] = '"'.$id_array[$i].'":"'.$type_array[$i].'"';
$javascript_array1[$i] = '"'.$id_array[$i].'":"'.$type1_array[$i].'"';
}
?>
<script language="JavaScript">
<?php
//echo javascript array var notes = {"key1:value1", "key2:value2", ...}
echo 'var notes = {'.implode(',',$javascript_array).'};';
echo 'var notes2 = {'.implode(',',$javascript_array1).'};';
?>
function change(id)
{
document.getElementById('inv_type_note').innerHTML = notes[id];
document.getElementById('inv_type_note2').innerHTML = notes2[id];
}
</script>
The query doesnt work right(gives javascript error) but if I enter a less amount of data into the database table then the query works fine.
Any ideas why this is?
Thanks.