Results 1 to 12 of 12

Thread: Need help : send & query image in php

  1. #1
    Join Date
    Oct 2007
    Location
    Penang
    Posts
    3
    Rep Power
    0

    Need help : send & query image in php

    Hi all..
    nak mintak tolong skit kat sifu2 php yang ader kat dalam forum nih.

    1. macamana nak upload image guna form dari file php ke database.
    2. Macamana nak query image dari database ke file php.

    dua benda nih jer yang masih sy tak paham2.. yang lain rasanya takder masalah. Ader banyak buku basic tak terangkan benda nih walau beratus2 mukasurat.

    rasanya kena pakai path jer kot simpan kat dalam table then passing image ke folder. ader yang boleh bantu tak?

  2. #2
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    271
    rasanya kena pakai path jer kot simpan kat dalam table then passing image ke folder. ader yang boleh bantu tak?
    ko dah jawab sendiri.
    mmg database cuma simpan path / url dimana image tu berada..
    untuk upload gambar tuh, kene CHMOD folder, function2 seperti fopen, fwrite, fclose dan path kene paham.. aku dulu2 pernah buat..

    pastuh pening.. , pastuh aku reverse engineering... pastu... incomplete

  3. #3
    Join Date
    Oct 2007
    Location
    Penang
    Posts
    3
    Rep Power
    0

    fenin..fenin...

    semakin banyak dibaca semakin banyak pulak soalan terkeluar dari kepala otakku ini..

    mula2 nak tahu macamana nak buat database..dah tahu pastu nak tahu macamana nak hantar data ke database.. dah tahu pastu nak tahu camana nak query data dari database..dah tahu pastu nak tahu camana nak tahu nak upload gambar / path ke database.. belum tahu dah datang soalan lain pula.. camana nak set LIMIT 0.20 dan gunakan button next utk data seterusnya dalam query sesuatu data...fuh.. fenin2 fenin2..

    survey2 banyak article tapi yang boleh dipercayai artikel kat phpbuilder.com boleh lah tahan..

  4. #4
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    271
    nampaknya macam... basic pun tak faham.. susah la..
    php bukan macam 1 + 2 = 3

    lepas paham php kene paham jugak query mysql..
    nak belajar mysql pun bukan bleh dalam masa seminggu..

    sebelum tuh html jangan lupa.. HTML paling penting.

    cita2 tinggi mesti di turuti usaha yang jitu.
    jangan sangka semua bende senang macam mee segera
    kita belajar microsoft word mula2 pun susah kan..

    cuba cerita, apa yang anda pandai dan tahu pada masa sekarang.
    Last edited by mysticmind; 18-10-2007 at 08:50 PM.

  5. #5
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    Quote Originally Posted by mysticmind View Post
    ko dah jawab sendiri.
    mmg database cuma simpan path / url dimana image tu berada..
    untuk upload gambar tuh, kene CHMOD folder, function2 seperti fopen, fwrite, fclose dan path kene paham.. aku dulu2 pernah buat..

    pastuh pening.. , pastuh aku reverse engineering... pastu... incomplete
    soory bro.. i somehow also a beginner in php... i wanted to ask why not we just store the image on a blob field instead of url. is there any significant advantages to storing seperate on a folder?

    in ASP i used to store image in blob coz i don't need to bother about duplication of filename...

  6. #6
    Join Date
    Oct 2007
    Location
    Penang
    Posts
    3
    Rep Power
    0
    semalam dah baca artikel upload file to mysql ada dua cara, satu guna blob dan satu lagi guna path dengan command fopen fread dan bla-bla-bla.. rasanya guna cara menyimpan path di dalam mysql dan transfer image ke file ke folder lebih menarik...

    pastu baca artikel macamana nak wat paging!.. nampak mudah tapi kalau suruh tulis dari a-z mampus tak boleh.. anyway dah confident leh buat.

    hari nih nak study authenticate pulak!.. macamana nak guna password untuk masuk ke bahagian admin.. user registration, login dan lain2.

    nak study php nih kena tahu 'keywords' yang penting seperti variable, string, arrays, paging, authenticate, query, _GET, _POST bla-bla-bla

    kalau ader 'code bank' best gak leh copy jer..

    ader tak maner-maner web yang bekalkan code untuk kita copy dan guna?

    pastu mana nak dapat info tentang command2 seperti BETWEEN , FROM, INTO, SORTBY dan lain2 tu.. ker bedal jer guna english then php faham apa yang kita maksudkan?

  7. #7
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    you can try to search those ready made scripts at Hot Scripts :: The net's largest PHP, CGI, Perl, JavaScript and ASP script collection and resource web portal

    for SQL command and php syntax references, you refer to W3Schools Online Web Tutorials

  8. #8
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    271
    yes.. hotscript got most of it. Php.net is the parent of php source too

  9. #9
    Join Date
    Oct 2007
    Location
    Hulu Langat
    Posts
    3
    Rep Power
    0
    Quote Originally Posted by mimosa View Post
    Hi all..
    nak mintak tolong skit kat sifu2 php yang ader kat dalam forum nih.

    1. macamana nak upload image guna form dari file php ke database.
    2. Macamana nak query image dari database ke file php.

    dua benda nih jer yang masih sy tak paham2.. yang lain rasanya takder masalah. Ader banyak buku basic tak terangkan benda nih walau beratus2 mukasurat.

    rasanya kena pakai path jer kot simpan kat dalam table then passing image ke folder. ader yang boleh bantu tak?
    aku pernah ajar benda ni kat bebudak yang dah 1 thn+ buat php..
    diorang pun penin...

    jadi camna aku nak tolong yek???

    cam kata mysticmind belajar dulu HTML, SQL, PHP
    cam iamfreelancer senang simpan imej dalam blob...
    nak simpan dlm url susah nak maintain

  10. #10
    Join Date
    Oct 2007
    Location
    kl
    Posts
    30
    Rep Power
    0
    aiseh..dl aku penah buat ni..kalo xsilap aku masukkan dalam db MS sql 2000 kot. Kita leh insert gambar tu dalam db..tp table tu pilih data type binaryla(bukan string) ..pastu dia leh simpan la..emm..at least bg idea sket kot..tp xsure kalo dalam mysql leh x..patutnya sama gak...nant check balik code2 lm..kalo ada update,akan inform lg..

  11. #11
    Join Date
    Oct 2007
    Location
    kl
    Posts
    30
    Rep Power
    0
    oh..dalam mysql pn boleh gak simpan gambar..ni contoh implementation dia kalo guna asp.net,tp rasanya kalo paham,sedang jer nak apply ke php..php ni language y agak senang sebnya..so jangan riso..keep on learning..

  12. #12
    Join Date
    Oct 2005
    Location
    KLC
    Posts
    91
    Rep Power
    165
    yeah, images, or any binary files is storable in database fields. advantage is files are more secured. disadvantage is database eats lots of resources and bytes. which method to use is up to the programmer.

    to me, personally, storing binary files in database is simplest since you dont have to deal with directory permission, path checking, etc. also since i have access to Gig of space
    klaatu barada nikto

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Query Vs Array
    By semutpower in forum Website Programming
    Replies: 2
    Last Post: 30-01-2009, 02:44 PM
  2. Why my Query Not Working??
    By marukochan in forum Website Programming
    Replies: 3
    Last Post: 05-04-2007, 02:10 PM
  3. Help in query..
    By sweets in forum Website Programming
    Replies: 10
    Last Post: 27-03-2007, 10:39 AM
  4. Sql query untuk A+B-C ...
    By nixx in forum Website Programming
    Replies: 5
    Last Post: 06-10-2004, 04:51 PM
  5. how to secured query string
    By vash in forum Website Programming
    Replies: 3
    Last Post: 28-04-2004, 02:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112