/    Sign up×
Community /Pin to ProfileBookmark

images recall from php/mysql

Hello,
At the end of my newbie rope ; I have a working mysql database of film
posters with text fields (all VARCHAR) that give results fine. I wanted
to add pictures in a field called PICTURES instead of just “yes” or
“-“.
As everyone recommends, I included 5 links to pictures in that field
(such as : ABCD.jpeg – and – to be on safe side : ABCD.jpg) and
modified the script as best I could.

All I’m getting now is 5 broken images outside the table (corresponds
to actual number of images I’ve put links to) + 10 broken images in
appropriate table column (even though there are 5 only).
Link to actual page :
[url]http://www.cinemaposter.com/database.html[/url]
search for BARAN in field author.
I guess I’m condemned to writing 1000 html pages… Everyone says how
“easy” it is to use php to recall images, yet there is not a single
script that’d show exactly how to do it.
Begging for help, actual entire code below.
Tom

[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”
“http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd”>
<html>
<head>
<title>Search Results</title>
<meta name=”generator” content=”BBEdit 6.5″>
<style type=”text/css”>
td
{
color: #000000;
font-family: arial;
font-size: 10px;
}
</style>

</head>
<body>
[/code]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@aussie_girlJul 11.2006 — I think you have missed all your code in your message
[code=php]
$query = "SELECT picture FROM tablename";
$result = mysql_query($query);
list($pic) = mysql_fetch_array($result, MYSQL_NUM); //$pic holds the image name
echo "<table align="center"><tr><td><img src="$pic" height="150" width="200"></td>
</tr></table>";// shows the image as a thumbnail
[/code]
Copy linkTweet thisAlerts:
@tomkzauthorJul 11.2006 — for some reason, after pasting code, the preview here truncates it ?????

I think you have missed all your code in your message
[code=php]
$query = "SELECT picture FROM tablename";
$result = mysql_query($query);
list($pic) = mysql_fetch_array($result, MYSQL_NUM); //$pic holds the image name
echo "<table align="center"><tr><td><img src="$pic" height="150" width="200"></td>
</tr></table>";// shows the image as a thumbnail
[/code]
[/QUOTE]
Copy linkTweet thisAlerts:
@NogDogJul 11.2006 — I edited out the spurious text that appeared at the top of your post, and placed [ php ] tags around the code sample. You may now want to edit it and copy-and-paste the actual code between those tags, so that it's easier for us to read. -- MOD
Copy linkTweet thisAlerts:
@tomkzauthorJul 11.2006 — i'm totally lost here, can't even post code....
×

Success!

Help @tomkz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...