/    Sign up×
Community /Pin to ProfileBookmark

PHP Ajax need to find a good forum

I am looking to <img scr $items based on a field called “pic”> in mysql database, based on this dd.php script, that works with ajax. I think it’s just simple syntax around the echo, but I i’ve been looking at it so long, I’ve confused myself. Any help or a lead on a good forum would be appreciated. Here’s the piece in the code:

[code=php]
<h2>(S)Ajax Example</h2>
<p>In this example the fields are updated automatically in the DB when the item is dropped, using the AJAX method (SAJAX to implement with PHP)</p>
<br />

<ul id=”sajax1″ class=”sortable boxy”>
<?php
$r = mysql_query(“SELECT * FROM layout WHERE `set` = ‘sajax1’ ORDER BY `order` ASC”);
while($rw = mysql_fetch_array($r))
{
echo ‘<li id=”‘.$rw[‘item’].'”>’.$rw[‘item’].'</li>’;
}
?>
</ul>

<ul id=”sajax2″ class=”sortable boxy”>
<?php
$r = mysql_query(“SELECT * FROM layout WHERE `set` = ‘sajax2’ ORDER BY `order` ASC”);
while($rw = mysql_fetch_array($r))
{
echo ‘<li id=”‘.$rw[‘item’].'”>’.$rw[‘item’].'</li>’;
}
?>

</ul>
[/code]

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@so_is_thisNov 03.2006 — So... What is going wrong? More info!
Copy linkTweet thisAlerts:
@danxavierauthorNov 03.2006 — This little script lets you move little text boxes around and change the order sequence. Instead of text boxes I would like to link the variables to images. I've set-up the fields and links in mysql database, but can't figure out the <img src=.... syntax in the code. Any ideas?

The script runs fine, and if youwant to see it in action, please check out the link on my website www.altusair.com/a_sort/dd.php
Copy linkTweet thisAlerts:
@so_is_thisNov 03.2006 — Change this:

echo '<li id="'.$rw['item'].'">'.$rw['item'].'</li>';

to this:

echo '<li id="'.$rw['item'].'"><img src="'.$rw['pic'].'" border="0" /></li>';
Copy linkTweet thisAlerts:
@danxavierauthorNov 03.2006 — Excellent, thank you. It works perfectly
Copy linkTweet thisAlerts:
@so_is_thisNov 03.2006 — You're welcome, De nada, Bitte.
×

Success!

Help @danxavier 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.19,
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,
)...