/    Sign up×
Community /Pin to ProfileBookmark

image problem

could someone please tell me why the images are not being output to the browser. echo $image prints out the correct location so there is no problem there (when i have hardcoded the location in the code, it outputs to the page fine).

[code]
for ($i = 0; $i<count($bookauthorArray); $i++){
$query = “SELECT Image FROM book WHERE Book_ID
= ‘$bookauthorArray[$i]'”;
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
$image = $row[“Image”];
echo $image;
echo “<tr>
<td><img src= $image width=100 height=100>
</td>
</tr>”;
}
}
[/code]

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@WebfreakMar 24.2004 — Try this [code=php]echo "<img src="$image" width=100 height=100>";[/code]
Copy linkTweet thisAlerts:
@vik_paauthorMar 24.2004 — thanks buddy. it works now
Copy linkTweet thisAlerts:
@vik_paauthorMar 24.2004 — right now I have another problem which is an extension of the code above as follows:
<i>
</i>for ($i = 0; $i&lt;count($bookauthorArray); $i++){
$query = "SELECT Title,Price,Publisher,Image FROM book <br/>
WHERE Book_ID = '$bookauthorArray[$i]'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
$image = $row["Image"];
echo $image;
echo "&lt;tr&gt;
&lt;td&gt;&lt;a href= bookdetails.htm&gt; &lt;img src=
"$image" width=125 height=150&gt;&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;";
}
}

When the user is redirected to bookdetails.htm, I want the title, price and publisher of the book to be sent to bookdetails.htm, where they will be displayed???
Copy linkTweet thisAlerts:
@WebfreakMar 24.2004 — You wan't to get title, price and publisher displayed on bookdetails.htm? I'm newbie in mysql, i can write php scripts, but not for mysql. ? Sorry.
Copy linkTweet thisAlerts:
@vik_paauthorMar 24.2004 — can any one tell me on how i can post the values to bookdetails.htm. will i need to use $_POST ???
Copy linkTweet thisAlerts:
@vik_paauthorMar 24.2004 — ive just realised the situation is more complex. i have to figure out which image the user selects and then post values based on the selected image???
×

Success!

Help @vik_pa 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.20,
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,
)...