This should be a simple thing listing in php sql my poetry script

Joined: 11/28/2008

Ok guys, I haven't scripted as much as I used to,
and the source files I could go back to were on my external hard drive, and that blew up and I'm in the process of re doing a new site from scratch, and this is the pain of it
I lost what i had, and I'm not sure where to go cause I honestly don't remember.

I'll show you what I have,
and I'll explain the issue a bit

<?PHP
include("thisistxt.php");
$resultnn = mysql_query("SELECT * FROM poetry");

while($row = mysql_fetch_array($resultnn))

{
(((( Individual Poem Here ))))

{
echo "";
echo "";
echo "" . $row['idrp'] . "";
echo "" . $row['ptitle'] . "";
echo "" . $row['pdate'] . "";
echo "" . $row['somelink'] . "";

echo "";

echo "";
}

?>

the somelink is where I want to be able to put a link so that the user could click it

and above that is were I want the poem to display that was selected

and I know I need the ID to be selected,

I honestly can't rememember what to do here, and it is honestly one of my more important parts of my site.

Joined: 10/18/2008
How do you want it to

How do you want it to display? You could use jquery to hide/show poems based on what the user clicks. You could use a form with a $_POST to only display what was selected, you could use a $_GET to do the same thing. So really depends on how you want to do it.

Depending on how much info there is and how long the poems are, I'd use jquery. Then everything is loaded once and the user just shows/hides what they want to see.

/ * Begin Signature */
It's a strange thing about determined seekers-after-wisdom that, no matter where they happen to be, they'll always seek that wisdom which is a long way off. Wisdom is one of the few things that looks bigger the further away it is.

Joined: 11/28/2008
say I have 5 poems I want it

say I have 5 poems

I want it to look like

1 Ode To An Apple 11/11/09 - Click Here To Read
2 Remember me 11/12/09 - Click Here To Read
3 My Xbox 11/13/09 - Click Here To Read
4 My cat 11/14/09 - Click Here To Read
5 My Love 11/15/09 - Click Here To Read

this is represented by for example 1 = idrp Ode To An Apple = ptitle 11/11/09 = pdate
I want to be able to make click here to read a link
and that would display the poem which is thepoem

I can list the id title of the poem and date, but unable to turn the id into a link and i can figure out how to display the info for that one poem into a line

Joined: 11/28/2008
I need to get echo "";

I need to get

echo "";
echo "";
echo "" . $row['idp'] . "";
echo "" . $row['ptitle'] . "";
echo "" . $row['pdate'] . "";
echo "Click Here To Read The Poem" . $row['idp'] . "";

echo "";

echo "";

you click the link, and it sets it into a var so it knows what id to pull from

this is far from complete, but im at a loss until I can figure out that link part

<?PHP
include("thisistxt.php");
$resultnn = mysql_query("SELECT * FROM poetry");

while($row = mysql_fetch_array($resultnn))

{

SELECT * FROM poetry WHERE idp=" $pomid ";

{
echo "";
echo "";
echo "" . $row['idp'] . "";
echo "" . $row['ptitle'] . "";
echo "" . $row['pdate'] . "";
echo "Click Here To Read The Poem" . $row['idp'] . "";

echo "";

echo "";
}

?>

Joined: 11/28/2008
No one has any ideas?

No one has any ideas?

Joined: 11/27/2009
If you're still wondering...

Don't know if you got it right, but it obviously was at the top of the forum, so i'll reply anyway... =)

What you could do, and also has been suggested, is to use jQuery.
Only thing you need to do then is to, for each poem echo a syntax like follows

<ol class="poems">
<!-- foreach poem do: -->
<li><span class="title">Poem's title</span><a href="#" class="more">Read more</a>
<div class="poemtext">Lorem Ipsum (poem goes here...)</div>
<!-- stop foreach --></li>
</ol>

Then you will want to include something like the following jQuery (along with the jQuery lib of course)

$('.poemtext').hide();
$('.more').click(function(){$(this).siblings('.poemtext').show(); return false;});

All the code is untested, but i hope it might get you somewhere.

Regards,
Jonatan