954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Annoying query

How am i supposed to insert a word into a blank row?

$sql = "INSERT INTO ue-userfile WHERE id='$imageid' AND userid='$userid' (`albumname`) VALUES('$newalbum')";


?

$sql  = "
            INSERT INTO `ue-userfile` (
              ``,  ``, ``, ``, ``, ``,``,`albumname`
            )
            VALUES ('{$albumname}')";


?
God damn annoying to not find any solution on how to insert or update a blank row...

Sorcher
Junior Poster
191 posts since Oct 2010
Reputation Points: 16
Solved Threads: 9
 

http://dev.mysql.com/doc/refman/5.5/en/insert.html

$sql = "INSERT INTO ue-userfile (`id`, `userid`, `albumname`) VALUES ('$imageid', '$userid', '$newalbum')";
pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

i only need one inserted.

Sorcher
Junior Poster
191 posts since Oct 2010
Reputation Points: 16
Solved Threads: 9
 
mysql_query("UPDATE ue-userfile SET userid = 'The userid' WHERE id = 'the id'");


Is that what you wanted?

G&G Designing
Junior Poster in Training
90 posts since Aug 2011
Reputation Points: 17
Solved Threads: 11
 
if(isset($_POST['albumname']) && $_POST['imageid']){

	$newalbum = $_POST['albumname'];
	$newalbum = htmlentities($newalbum);
	
	$imageid = $_POST['imageid'];

	$imageid = htmlentities($imageid);
	$sql5 = "UPDATE ue-userfile SET albumname = '$newalbum' WHERE id = '$imageid'";
	$result5 = mysql_query($sql5);}


i've checked my connection to the database, also the outputs of the variables, its all fine. but it wont change the current album name to the new one $newalbum

Sorcher
Junior Poster
191 posts since Oct 2010
Reputation Points: 16
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: