Jump to content

Help a guy with classes :D


Procode

Recommended Posts

I am coding a simple guest book and i haven't made classes related to Smarty yet so i need help.

My code is as follows:

[code]function show_contacts($user_id){
$this->mysql = new mysql();
$sql = "SELECT * FROM `contacts` WHERE 'owner' = '".$user_id.'"'";
$this->contacts = $mysql->assoc_aray($sql);
while($this->contacts){
//what here ?
}
}[/code]

That is the code inside a class, i also made a mysql class before that but what do i have to put where it says "what here?" and what do i put in a .tpl file in smarty in order for it to list the contacts? :)

Thank you.
Link to comment
https://forums.phpfreaks.com/topic/27390-help-a-guy-with-classes-d/
Share on other sites

[quote author=Procode link=topic=115124.msg468667#msg468667 date=1163633795]
what do i have to put where it says "what here?"
[/quote]
That depends ENTIRELY on what you want it to do.


[quote author=Procode link=topic=115124.msg468667#msg468667 date=1163633795]
what do i put in a .tpl file in smarty in order for it to list the contacts? :)
[/quote]
You may very well the answer to this one here (SOMEONE here might able to assist), but I'd consider asking over at the SMARTY forums too.
http://www.phpinsider.com/smarty-forum/

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.