only the first character goes to my db

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yousef Altaf
    New Member
    • Jun 2011
    • 22

    only the first character goes to my db

    I am trying to add this image name into my db but it just takes the first character of the name.
    like if the image named JACK it takes 'J' only to my table
    this is the var I am pointed to
    Code:
    $imageUp
    at line 14

    Code:
    $uploadsDirectory = 'includes/adsImages/';
    		$fieldname = 'image';
    		$errors = array(
    			1 => 'php.ini max file size exceeded', 
                2 => 'html form max file size exceeded', 
                3 => 'file upload was only partial');
    		@getimagesize($_FILES[$fieldname]['tmp_name'])or error('يسمح فقط برفع الصور');
    		
    		$now = time();
    		while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'])){
    		$now++;
    		}
    	
    		$imageUp=move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename);
    	
    		echo "تم إضافة الأعلان و صورة الأعلان بنجاح<br />سوف يتم عرض أعلانك خلال 48 ساعة عمل المزيد";
    	
    	
    		$putData="INSERT INTO ads(id, kind, cat, name, email, mobile, landPhone, ads_tiltle, use_price, ads_description, dateAdd, image)VALUES
    		('', '$catid', '$kind', '$name', '$email', '$mobile', '$landPhone', '$adsSubjuct', '$price', '$adsDetails', NOW(), '$imageUp')";
    		$QputData=$db->query($putData)or die("$db->error");
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Double check your field definition in the table.

    Comment

    • MUJEEB I S
      New Member
      • Jun 2012
      • 9

      #3
      Go to your db_name in your php my admin panel
      -> and select your table
      ->select ads table
      ->and click Structure menu
      ->and point the image row and click (Action) Change
      -> look the failed Length/Values
      -> change the values in 50 or 25
      -> click save

      now run your program and check once again ...
      The problem is the length is overflow

      have a nice day

      Comment

      Working...