Jump to content

Need help with this.


Procode

Recommended Posts

What am i missing?

My MySQL class code:

[code]function assoc_array($sql){
$this->do_connect();
$sql_result = mysql_query($sql) or die(mysql_error());
if (!$sql_result)
        {
            $sql_error = mysql_error();
            echo "<br>";
            echo "<p>".$this->mysql['gen_error']."</p>"; 
            return(false);
        }
        else
        {
            $info = mysql_fetch_assoc($sql_result);
            return ($info);
        }
[/code]

And in my actual class the code is:

[code]function members_main(){
$smarty = new Smarty();
$mysql = new mysql();
$sql = "SELECT * FROM `user` WHERE username = '".$_SESSION['user']."' LIMIT 1";
$info = $mysql->assoc_array($sql);
$smarty->assign('full_name', $info['name']);
$smarty->assign('username', $info['username']);
$smarty->assign('email', $info['email']);
}
[/code]

it basicly shows up blank in smarty, means it doesnt work. Whats wrong?

The session does work i checked.
Link to comment
https://forums.phpfreaks.com/topic/29267-need-help-with-this/
Share on other sites

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.