I have added time stamp and date when the details should create. and the time stamp and date will add in database. When i’ll retrieve it from db it wanna to show only that string name without time stamp and date ? how to make it?
Adding Method….
$imagename = $_POST['imagename'];
$imageNameExt = $_POST['imageNameExt'];
$newImgName = trim($imagename).'_'.date('Y_m_d_H_i_s').'.'.trim(strtolower($imageNameExt));
Here consider the $imagename = "abc"; and $imageNameExt = "jpg"; when it'll insert into db the name as $newImgName = "abc_2011_07_12_18_47_02.jpg"....
Now i need to retrieve from db..How should i print only the name “abc” with out the time stamp and date??
Thanks in advance.
Update : (I couldn’t post this as a answer bcoz am under 100 reputation.)
found the answer for my question:
While am retrieving it’ll come in the name of image_path,
$image_path = $rows[0];
$tmp = "_".date('Y');
$ImgOrgName = explode($tmp,$image_path);
$ImgOrgName_core = $ImgOrgName[0];
The Image name “abc” will come in the string “$ImgOrgName_core”.
Try it…i’m easily getting the answer when i use like this.
found the answer for my question:
While am retrieving it’ll come in the name of image_path,
The Image name “abc” will come in the string “$ImgOrgName_core”.
Check it…i’m easily getting the answer when i use like this.