Jump to content

Simply edit a field in the DB


baked

Recommended Posts

I'm trying to edit the advertisement field in this database using Celerondude's upload script. However, it doesnt seem to work and I can't figure it out. Would anyone care to take a look?

 

elseif ( $action == 'editadvert' )
{
if ( $task == 'save' )
{
	$ad_id  = gpc ( 'ad_id', 'P');

		$mysqlDB->query ( sprintf ( "UPDATE uploader_users SET advert_id='$ad_id' WHERE userid=%d;", (int)$ad_id, $UPL['USER']['userid'] ) );

	// back to preferences
	header ( 'Location: ' . $_SERVER['HTTP_REFERER'] );
}
else
{
	// show form
	$inf = array
	(
		'ad_id'	=> $UPL['USER']['advert_id'],
	);
	$tpl_usercp->set ( 'user', $inf);
	$tpl_uploader->set ( 'content', $tpl_usercp, '$ad_id' );
}
}

 

All I'm getting for the output is "0"..

 

thank you.

Link to comment
https://forums.phpfreaks.com/topic/179303-simply-edit-a-field-in-the-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.