Two quick Q's...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tbatest
Forum Newbie
Posts: 2
Joined: Sun Aug 06, 2006 12:19 pm
Location: Exeter, UK

Two quick Q's...

Post 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]
User avatar
tbatest
Forum Newbie
Posts: 2
Joined: Sun Aug 06, 2006 12:19 pm
Location: Exeter, UK

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

try

Code: Select all

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