Welcome every Guy's when I'm Coding Simple Uploading File Image appeared Error : <!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>Uploader Files</title> </head> <body> <?php require_once('Connection.php'); if(isset($_POST['submit'])) { $Type = $_POST['type']; $Image = $_FILES['file']['name']; $Image_type = $_FILES['file']['type']; $Image_size = $_FILES['file']['size']; if(!empty($Type) && !empty($Image)) { if((($Image_type == 'image/gif') || ($Image_type == 'image/jpeg') || ($Image_type == 'image/png')) && ($Image_size > 0) && ($Image_size <= GW_MAXFILESIZE)) { if($_FILES['file']['error'] == 0) { $target = GW_UPLOADPATH . $Image; move_uploaded_file($_FILES['file']['tmp_name'],$target); $dbc = mysql_connect(DB_HOST,DB_USER,DB_PASS); mysql_select_db (DB_DataBase); $QueryInsert = "INSERT INTO upload (type,image) VALUES ('$Type','$Image')"; mysql_query($dbc,$QueryInsert); mysql_close($dbc); } else { echo '<p>Sorry, there was A Problem Uploading Your Image.</p>'; } } else { echo '<p class="error">The Image must be a GIF, JPEG, or PNG image file no greater than ' . (GW_MAXFILESIZE / 1024) . ' KB in size.</p>'; } } else { echo '<p class="error">Please Enter all of the Information to add your Image.</p>'; } } ?> <H3>Simple Uploading Image File !</H3> <br /><br /> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" enctype="multipart/form-data"> <label>Type File :</label><br /><br /> <input type="text" name="type" value="" /><br /><br /> <label>Path File :<br /><br /> <input type="file" name="file" id="file" /><br /><br /> <input type="submit" value="Upload" name="submit" /><br /><br /> </form> </body> </html> PHP: The Error in : $QueryInsert = "INSERT INTO upload (type,image) VALUES ('$Type','$Image')"; PHP: mysql_query() expects parameter 1 to be string Thanks
Thanks mazako and danx10 I'm Solved the Problem in : $QueryInsert = "INSERT INTO upload (type,image) VALUES ('$Type','$Image')"; mysql_query($QueryInsert); PHP: