Skip to main content
Inspiring
November 7, 2007
Question

Constructing MYSQL DB/PHP: Image question

  • November 7, 2007
  • 3 replies
  • 309 views
Hello all,

I have two of David Powers' books and I'm getting better by the day at
PHP and MYSQL. However, I am stuck in the planning phase of a new
website and I'm wondering if someone could give me "I'd do it this way"
pointers.

I have a DB set up for news articles, and these news articles are
generally about events that have taken place. Photos are taken of these
events, and are all different sizes and aspect ratios.

What I'd like to be able to do is have an Admin page on a CMS that
allows for not only the insertion of a headline/subhead/body, but also
an image. I'd like the image to be uploaded to the website (not the DB,
which is hosted on a different server), with a link automatically
generated so that when the detail page is called from the master page,
the image shows up in a div that I have constructed for the detail page.
Also, if there's not an image available for the event, I'd like the page
to display correctly without showing a broken image icon.

How would I go about planning for this, and do I need an extension that
performs the PHP upload, etc? I've seen some out on the web from some
different sites, but I'm at the point where I know that "I don't know
what I don't know" about this subject and I'm not sure of the correct
questions to ask.

Thank you anyone for any pointers you can give me.

-John
This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Inspiring
November 13, 2007
I meant to get back to you two and tell you thank you for your
responses. This will help.

-John

Hunter Elliott wrote:
> "David Powers" <david@example.com> wrote in message
> news:fgssap$3fv$1@forums.macromedia.com...
>
>> I've not used any of the extensions, so can't comment on how good/bad
>> they are.
>
> I've used DMXzone's PureASP upload - I presume their PHP upload extension is
> similar. It's pretty good and I like the ability to limit which types of
> files can be uploaded. I've used WebAssist's Digital File Pro upload
> extension - I find it a lot less user-friendly than DMX' and there's no
> ability to restrict file type (except that it be an image format).
>
>
Inspiring
November 7, 2007

"David Powers" <david@example.com> wrote in message
news:fgssap$3fv$1@forums.macromedia.com...

> I've not used any of the extensions, so can't comment on how good/bad
> they are.

I've used DMXzone's PureASP upload - I presume their PHP upload extension is
similar. It's pretty good and I like the ability to limit which types of
files can be uploaded. I've used WebAssist's Digital File Pro upload
extension - I find it a lot less user-friendly than DMX' and there's no
ability to restrict file type (except that it be an image format).


Inspiring
November 7, 2007
John R. Lenz wrote:
> I have two of David Powers' books

Only two? ;-)

> What I'd like to be able to do is have an Admin page on a CMS that
> allows for not only the insertion of a headline/subhead/body, but also
> an image. I'd like the image to be uploaded to the website (not the DB,
> which is hosted on a different server)

You can either hand-code the image upload (there are details in "PHP
Solutions"), or get an extension to handle it for you. I've not used any
of the extensions, so can't comment on how good/bad they are.

> Also, if there's not an image available for the event, I'd like the page
> to display correctly without showing a broken image icon.

That's a simple if... else condition.

if (!empty($row_recordsetName['image'])) {
// display the image
}

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/