Search
Left Quote    Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: uploading images with php tutorial - help with storing image
  This user is offline  barbs75
  Subject: "uploading images with php tutorial ..." Posted: @ 2:00 pm on Apr 04 2008   
Member #: 652
Rank: User - (3)
Since: 04/04/08
Posts: 3
From: Swindon, UK

Hey,

I have been using the tutorial on this site called 'uploading image files with php' which has been extremely useful and why executed, so thankyou!!

The only issue i have is with inserting the image data into the database...

I ahve already got my own complete login/registrat ion system, and are therefore trying to inegrate this code into my system.

I noticed that the sql to enter the image data into the database isn't on the example, so i would like to know where i would put this code, and how when changing the filename of the image and placinng inot the database, it uses $_SESSION['user _id'] to reference to the user's records, but the table will be empty of the user hasn't entered an image, and their user_id wont be able to match up to anything!?!?

am i missing something?

any help would be great,


cheers Craig
craigbarber75@h
otmail.com |     Viewed: 5,473 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: uploading images with php tutor..." Posted: @ 6:20 pm on Apr 04 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Storing the name of the image in the database is no different than anything else. The image name is in the variable: $filename - so you could just update it like this:

$q = mysql_query(&q uot;UPDATE `tablename` SET image_column_na me = (".$filen ame.") WHERE username = ".$userna me."&quo t;);

something like that should work.




-bs0d | AllSyntax.com

    Viewed: 5,464 Times | Reply to This | To top
  This user is offline  barbs75
  Subject: "re: uploading images with php tutor..." Posted: @ 10:00 am on Apr 11 2008    
Member #: 652
Rank: User - (3)
Since: 04/04/08
Posts: 3
From: Swindon, UK

Hey, cheers for your reply

Got it all working a treat since i posted my question, it all works fine and dandy!

Cheers for your tutorial, it rocks, made this procedure very straight forward to do, cheers!!

Craig




cheers Craig

craigbarber75@h
otmail.com |     Viewed: 5,392 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank