Page 1 of 1

Two quick Q's...

Posted: Sun Aug 06, 2006 2:21 pm
by tbatest
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello all!

1st, the easy one: 

When writing a post, how do you display code highlighted in different colors? is it something to do with the hightlight_string() function? I had a quick search but couldn't find it.

2nd, bonus question...

Anyone familiar with POG? It writes an easy to use (well, for most; I'm fairly new at this!) databases?

Anyways, I have a table in a database named 'SS', each object when entered as two attributes: 'title', and 'story'. I'm using GET to retrieve the story body from a list of titles, and have it display to the right of the list (an html anchor posts the GEt info, it all works fine):

Code: Select all

<?php
				$currentitle = $_GET['currentitle'];
				$item = new SS();
				$calleditem = $item->GetList(array(array("title","=", $currentitle )));
				
				
				
				if ($_GET['currentitle'] == "") {
				
					echo"<p>nothing clicked yet</p>";
		
				
				}else {
					
				       echo "<h1>the current title is $currentitle->title</h1>";
					echo "<p></br></br>$calleditem->story</p>";
					
				}
			
				?>
Well... it doesn't work. Any idea why? Thanks for the help...

Tom


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Aug 06, 2006 2:37 pm
by tbatest
Sorry, to be slightly more specific....

The $calleditem->title and $calleditem->story arn't displaying for some reason.

(I've just spotted that I called it $currentitle->title in the first post, my mistake)

I apologise for the errors!

Thanks for the help

tom

Posted: Sun Aug 06, 2006 4:01 pm
by feyd
try

Code: Select all

echo '<h1>the current title is ' . $currentitle->title . '</h1>';
                                        echo '<p></br></br>' . $calleditem->story . '</p>';