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
https://forums.phpfreaks.com/topic/705-cycling-through-row-data-is-not-working/
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:

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.