<?php
$con = mysql_connect("localhost","root","")or die (mysql_error());
mysql_select_db("registration", $con);
function protect($value){
$value=mysql_real_escape_string($value);
$value=stripslashes($value);
$value=strip_tags($value);
}
if(isset($_POST) && $_FILES >0)
{
$fileName = $_FILES;
$tmpName = $_FILES;
$fileSize = $_FILES;
$fileType = $_FILES;
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
$sql = "INSERT INTO signup_image (name, size, type, content ) VALUES ('$fileName', '$fileSize', '$fileType', '$content')";
$result = mysql_query($sql,$con);//PROBLEM HERE(LINE 121)
if($result>0)
{
echo"<p>file $fileName uploaded</p>";
}
}
mysql_close($con);
?>
when i try to send file i got message MySQL server has gone away on line 121
so please help me!

just notify which is line 121 ....i can only see few lines...
and by the way use CODE tag to write code....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.