Jump to content

andrewjamesb

New Members
  • Posts

    2
  • Joined

  • Last visited

andrewjamesb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I would be ever so grateful if there is a PHP / MYSQL genius out there that can solve this annoying issue I have I have a member site with just 3 test members at present. Where users can simply send and receive internal messages to each other. The messaging system works to a fashion. However when a user goes to send a message to another user the following error occurs; Database error: Invalid SQL: insert into sky_message (to_id,from_id,subject,message,send_date) values('1','3','testy','another test',now()) MySQL Error: 1062 (Duplicate entry '1' for key 1) Session halted. Database error: Invalid SQL: insert into sky_message (to_id,form_id,subject,message,send_date) values('4','2','test','another test',now()) MySQL Error: 1062 (Duplicate entry '2' for key 2) Session halted. Database error: Invalid SQL: insert into sky_message (to_id,form_id,subject,message,send_date) values('3','2','test','again',now()) MySQL Error: 1062 (Duplicate entry '3' for key 1) Session halted. Within mysql table called sky_member I have set member id to int(5) and there are currently 3 members with member_id as primary key with auto_increment 1,2,3 (1 for 1st member, 2 for second and so forth) table called sky_message The problem is there is a sky_message table with fields; to_id, from_id and msg_id. These values are conflicting with the member_id value within the sky_member table. Please help solve this one? I have attached screen shots of both tables mesageissues2.doc
  2. Hi I have created an upload_video.php page and having issues with it. Hoping that some PHP genius can help me out a little for which I would be ever so grateful. Change my video page does not display video thumb images. Linked to include/generatevideothumb.php In my upload_video.php page I have defined thumb variables as follows // Thumb size $th_max_height1 = 150; $th_max_width1 = 250; $th_max_width = 55; $th_max_height = 55; $thumb_dir="upload/video/thumbs/"; $thumb_dir1="upload/video/thumbs1/"; // Thumb $thumb_video_name=$video_name; generatevideothumb($dir,$th_max_width, $th_max_height,$thumb_dir,$thumb_video_name); generatevideothumb($dir,$th_max_width1, $th_max_height1,$thumb_dir1,$thumb_video_name); --------------------------------------------------------------------------------------------------------------------------------------------- Complete code from generatevideothumb.php below <?php function generatevideothumb($im_file,$th_max_width, $th_max_height,$thumb_dir,$thumb_video_name) { @chmod($im_file,0777); $image_attribs = getimagesize($im_file); if($image_attribs[0]>$th_max_width) { $ratio = $th_max_width/$image_attribs[0]; $th_width = $image_attribs[0] * $ratio; $th_height = $image_attribs[1] * $ratio; } elseif($image_attribs[1]>$th_max_height) { $ratio = $th_max_height/$image_attribs[1]; $th_width = $image_attribs[0] * $ratio; $th_height = $image_attribs[1] * $ratio; } else { $th_width = $image_attribs[0]; $th_height = $image_attribs[1]; } //This code below is where I get that error saying invalid image dimensions $im_new = imagecreate($th_width,$th_height); //returns an image identifier representing a black image of size x_size by y_size. $th_file_name = $thumb_dir.$thumb_video_name; @chmod($th_file_name,0777); if($image_attribs[2]==2) { $im_old = imageCreateFromJpeg($im_file); imagecopyresized($im_new,$im_old,0,0,0,0,$th_width,$th_height, $image_attribs[0], $image_attribs[1]); imagejpeg($im_new,$th_file_name,100); } elseif($image_attribs[2]==1) { $im_old = imagecreatefromgif($im_file); imageCopyResampled($im_new,$im_old,0,0,0,0,$th_width,$th_height, $image_attribs[0], $image_attribs[1]); imagegif($im_new,$th_file_name,100); } } ?> videoissue.doc
×
×
  • 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.