sos help

Reply

Join Date: Sep 2008
Posts: 3
Reputation: ayshasherilps is an unknown quantity at this point 
Solved Threads: 0
ayshasherilps ayshasherilps is offline Offline
Newbie Poster

sos help

 
0
  #1
Sep 23rd, 2008
can anybody please tell me how to insert and retrieve an image stored in a database using php and mysql.the way i m doing now is by storing the file in a server and filename in the db.but the problem with that is while retrieving the image doesnt show up.db entries are all correct..but due to some reason i cant display the file in my webpage.please help...dis is very urgent.i m badly running out of time..thanx in advance
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,071
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: sos help

 
0
  #2
Sep 23rd, 2008
Last edited by Shanti Chepuru; Sep 23rd, 2008 at 9:29 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 517
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 83
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: sos help

 
0
  #3
Sep 23rd, 2008
Personally I would not use the second example-saving images into the Database, there is no need.

The filesystem was designed to do this job so why re-invent the wheel? I have yet to come across a scenario where storing images in the database is better than the filesystem.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 3
Reputation: ayshasherilps is an unknown quantity at this point 
Solved Threads: 0
ayshasherilps ayshasherilps is offline Offline
Newbie Poster

Re: sos help

 
0
  #4
Sep 24th, 2008
thank u so much for ur instant reply.i'll try to qoute my problem here

its like this..
  1. //retrieve the filename from db using a select query
  2. $result= mysql_result("SELECT imagename FROM imagetab");
  3. $row=mysql_fetch_array($result);
  4. //then i placed an image object with dynamic source like this
  5. <img src="<?php echo $row[0]; ?>"/>

This is works fair in a localmachine with host as localhost but when deploys it in the hosting space and run as a normal web page i just can't stand it ,i cant see the image.and i am not able to think of reasonable answer.can u help me out of this?
Last edited by peter_budo; Sep 25th, 2008 at 4:33 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 3
Reputation: ayshasherilps is an unknown quantity at this point 
Solved Threads: 0
ayshasherilps ayshasherilps is offline Offline
Newbie Poster

Re: sos help

 
0
  #5
Sep 24th, 2008
thank u for all who spared a moment to look into my problem.finally i got the answer the problem is with my upload code to upload the image .now i want to sort it out.so again i need help from ur side .how to set file permissions using php
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,071
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: sos help

 
0
  #6
Sep 24th, 2008
take a look at this fuction:
chmod($pro_imgpath,0777);
  1. <?php
  2. // Read and write for owner, nothing for everybody else
  3. chmod("test.txt",0600);
  4.  
  5. // Read and write for owner, read for everybody else
  6. chmod("test.txt",0644);
  7.  
  8. // Everything for owner, read and execute for everybody else
  9. chmod("test.txt",0755);
  10.  
  11. // Everything for owner, read for owner's group
  12. chmod("test.txt",0740);
  13. ?>
And 777- Everybody (i.e. others) has full rights.
Last edited by Shanti Chepuru; Sep 24th, 2008 at 5:29 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 22
Reputation: isaackhazi is an unknown quantity at this point 
Solved Threads: 0
isaackhazi isaackhazi is offline Offline
Newbie Poster

Re: sos help

 
0
  #7
Sep 24th, 2008
Or while uploading it using an FTP client just right click on the folder or file and go to properties. There change the access levels by just typing in the code eg: 777 etc....


ps: do this to the files already on the server
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 850
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: sos help

 
0
  #8
Sep 24th, 2008
Originally Posted by xan View Post
Personally I would not use the second example-saving images into the Database, there is no need.

The filesystem was designed to do this job so why re-invent the wheel? I have yet to come across a scenario where storing images in the database is better than the filesystem.
For one thing, it makes password protection of images much easier to work with and more secure.
Last edited by R0bb0b; Sep 24th, 2008 at 8:31 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC