0

I am new to php and mssql. I want to insert large text so i am using image data type in mssql. please tell me query so that i can able to insert data in image data type.

thanks in advance

<?php
$sqlconnect=odbc_connect($dsn,$username,$password);
if($sqlconnect){echo"connected";}
else{echo"not";}
$sqlquery="insert into info (name, adress) values ('$name','$adress')";
$process=odbc_exec($sqlconnect, $sqlquery);

echo "Data successfully inserted"; 

}
odbc_close($sqlconnect);


?>
  • The `TEXT` datatype is far more than enough. – Shankar Narayana Damodaran Jan 26 '14 at 06:32
  • The `IMAGE` type is deprecated - http://technet.microsoft.com/en-us/library/ms143729.aspx. If you are storing string text, store as `VARCHAR(MAX)` if it is going to be really large and contain non-latin characters; otherwise use `NVARCHAR(MAX)` - http://stackoverflow.com/questions/144283/what-is-the-difference-between-varchar-and-nvarchar – MarkD Jan 26 '14 at 06:35
  • thanks. but i want to insert in image datatype. please help me. – user2270100 Jan 26 '14 at 06:35
  • Thanks MarkD. infact i have a database so i want to fetch some data from column having image datatype and also insert some data into that. – user2270100 Jan 26 '14 at 06:42

0 Answers0