Jump to content

Cycling through row data is not working


Avalanche

Recommended Posts

[php:1:3d07c06ba5]<?php

$query_events = mysql_query(\"SELECT * FROM bob_events ORDER BY ID DESC\");

?>[/php:1:3d07c06ba5]

 

[php:1:3d07c06ba5]<?php

while($r=mysql_fetch_array($query_events)) { // cycle through events

$event=$r[\"event\"]; // turn row variable to regular variable

$event = addslashes($event);

echo \"scrollercontent[0]=\'<b>-</b> $event\'n\"; // add on to scrollies

}

?>[/php:1:3d07c06ba5]

 

I have two events in the table, but it will only echo the last one.

 

The two ones are: \"Cool Website Scripts\" and \"New addition to the Wile\'s family.\"

 

Any idea why this is not working?

 

Thanks.

Link to comment
Share on other sites

I know, I was going to fix that later...

 

anyway, I just figured out what it was.

 

I had it start echoing it on one of the JavaScript\'s comment lines instead of a command line... I just had to add a n to the echo above it and it all worked out.

 

Whoops. :roll:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.