Jump to content

inserting variables into db


Recommended Posts

<?php $filename = $HTTP_POST_FILES['image']['name'];$filesize = $HTTP_POST_FILES['image']['size'];$filetype = $HTTP_POST_FILES['image']['type'];$gallery = $_POST['galv'];mysql_connect("localhost","root","***********")or die("connection error");mysql_select_db("galleries")or die("database error");if (!isset($gallery)) {	die("no gallery selected");} else {	$sql = "INSERT INTO" . $gallery . "(name)VALUES(' " . $filename . " ')";	$result1 = mysql_query($sql);	if (!$result1){	die("error adding files".$gallery.$filename);	}?>

i want that to read something like"INSERT INTO g1(name)VALUES('p10234.jpg')";

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...