Jump to content

Php and Mysql Keywords


Deanznet

Recommended Posts

 

Okay i got the script to search for images. but im having a hard time to insert keywords into a box and upload it to the db. i can upload random strings into the keyword field but cant figure out how to make the textbox for the multiupload.

 

 

My keyword text box are names input name="keyword" type="text" size="50" />

 

The problem is the $keyword part.

	$extension = $mmhclass->funcs->file_extension($mmhclass->input->file_vars['userfile']['name'][$i]);
				$filename  = ($mmhclass->funcs->random_string(20).".{$extension}");
                    $keyword =   $_POST["keyword"];
				$thumbnail = $mmhclass->funcs->thumbnail_name($filename);
				$filetitle = strip_tags((strlen($mmhclass->input->file_vars['userfile']['name'][$i]) > 20) ? (substr($mmhclass->input->file_vars['userfile']['name'][$i], 0, 20)."...") : $mmhclass->input->file_vars['userfile']['name'][$i]);

 

 

 

 

This Works.

$mmhclass->db->query("INSERT INTO `mmh_file_storage` (`filename`, `is_private`, `gallery_id`,`keyword`,  `file_title`) VALUES ('{$filename}', '{$mmhclass->input->post_vars['private_upload']}', '{$mmhclass->info->user_data['user_id']}','{$keyword}', '{$filetitle}'); ");

Link to comment
https://forums.phpfreaks.com/topic/94005-php-and-mysql-keywords/
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.