473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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
Expand|Select|Wrap|Line Numbers
  1. $imageUp
at line 14

Expand|Select|Wrap|Line Numbers
  1. $uploadsDirectory = 'includes/adsImages/';
  2.         $fieldname = 'image';
  3.         $errors = array(
  4.             1 => 'php.ini max file size exceeded', 
  5.             2 => 'html form max file size exceeded', 
  6.             3 => 'file upload was only partial');
  7.         @getimagesize($_FILES[$fieldname]['tmp_name'])or error('يسمح فقط برفع الصور');
  8.  
  9.         $now = time();
  10.         while(file_exists($uploadFilename = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'])){
  11.         $now++;
  12.         }
  13.  
  14.         $imageUp=move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename);
  15.  
  16.         echo "تم إضافة الأعلان و صورة الأعلان بنجاح<br />سوف يتم عرض أعلانك خلال 48 ساعة عمل المزيد";
  17.  
  18.  
  19.         $putData="INSERT INTO ads(id, kind, cat, name, email, mobile, landPhone, ads_tiltle, use_price, ads_description, dateAdd, image)VALUES
  20.         ('', '$catid', '$kind', '$name', '$email', '$mobile', '$landPhone', '$adsSubjuct', '$price', '$adsDetails', NOW(), '$imageUp')";
  21.         $QputData=$db->query($putData)or die("$db->error");
Jan 23 '13 #1

✓ answered by MUJEEB I S

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

2 1618
Rabbit
12,516 Expert Mod 8TB
Double check your field definition in the table.
Jan 23 '13 #2
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
Jan 24 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Gary | last post by:
Morning all, I have a form field called: Bsk01 How do I onBlur prompt the user to enter a ZERO as character one, if one is not already entered. At the same time, I would like to ensure at...
2
by: D.Frangiskatos | last post by:
Hi, I have been working for a few months in project that deals raw sockets. However recently, and while trying to examine the contents of the buffer used in recvfrom i was a bit confused. The...
0
by: seanmayhew | last post by:
Im having a small problem with my Dataview sort. Its sorting correctly on the first character but after thats it seems random so for a state list at the "W's" it looks like this: WA WV WY WI...
2
by: bmayer | last post by:
I am using a SqlDataSource to put data into a database from three TextBoxes. The problem is that only the first character from the TextBoxes is being inserted into the database. The code: ...
12
by: Frank | last post by:
There must be an easier way then what I'm doing to determine if the first character in a string is a valid letter. My code is getting to big. There must be a better way. Thanks in advance
5
by: manu99 | last post by:
hi all, I have developed a console application with MFC and unicode supported using Visual studio.net 2003. The problem I have is that the output stream is displaying only the first character in...
9
by: sovht | last post by:
System: Intel, Windows XP Pro, SP2 IDE: VC++ 6.0 Problem: *Very* simple program to create a MessageBox only ever displays the first character of the given string. I checked the spec for the...
6
by: Academia | last post by:
I want to search for Dim and replace it with Dim That is, I want to change the first character of Dim variable names to upper case. I can't figure know to use Regular Expression to do that....
1
by: bdbeames | last post by:
I have a form where I would like to perform some validation using a javascript function. I cant' figure out the RegExp. function is_number(target) { target.value = trim(target.value); ...
2
by: ahmadasghar | last post by:
Hello, I am a beginner at C# and am using it to develop an application to control a robot remotely. To communicate with the robot I am using UDP. I am able to successfully send instructions to it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.