0

1.<?php
2.$con = mysql_connect("localhost","root","")or die (mysql_error());
3.mysql_select_db("registration", $con);
4.function protect($value){
5.$value=mysql_real_escape_string($value);
6.$value=stripslashes($value);
7.$value=strip_tags($value);
8.}
9.if(isset($_POST) && $_FILES >0)
10.{
11.$fileName = $_FILES;
12.$tmpName = $_FILES;
13.$fileSize = $_FILES;
14.$fileType = $_FILES;
15.$fp = fopen($tmpName, 'r');
16.$content = fread($fp, filesize($tmpName));
17.$content = addslashes($content);
18.fclose($fp);
19.if(!get_magic_quotes_gpc())
20.{
21. $fileName = addslashes($fileName);
22.}
23.$sql = "INSERT INTO signup_image (name, size, type, content )
24.VALUES ('$fileName', '$fileSize', '$fileType', '$content')";
25.$result = mysql_query($sql);
26.$inserted_id = mysql_insert_id();
27. if($result) {
28. echo "<p>File $fileName uploaded</p>";
29.}
30.else{
31.echo"<p>file failed to be uploaded</p>";
32.}
33.}
34.mysql_close();
35.?>
if i try to upload i got message MySQL server has gone away in C:\wamp\www\""\photo.php on line 25
i try to look how but i failed to get answer plz help me.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by dornaled
0

Try This:

$sql = mysql_query("INSERT INTO signup_image (name, size, type, content) 
		
VALUES('$fileName', '$fileSize', '$fileType', '$content'") or die (mysql_error());
0

hi


suggest you try this .......joban.ali...... provide information.
and i think is solv the problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.