Jump to content

bluestar

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bluestar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i am making a website and some part of which is to show user information...for this i had make a class and functions within it...one of the function is for retrieving values from database(im using mysql)...i know a variable is limited only in function,also tried $_session for this too..the function works fine ....but it is not sendind the information to the page from where im calling it...here is my code..... in xyz.php file <?php class book{ public $v1; public $v2; public $v3; function book(){ } function page1(){ $this->con=mysql_connect("localhost","root","usa"); $this->db=mysql_select_db("truth",$this->con); } function page2($xyz){ $this->page1(); $query="SELECT * FROM member_signup WHERE Uid=$xyz"; $result=mysql_query($query,$this->con); $result1=mysql_fetch_array($result); $_SESSION['info']=$result1; return $_SESSION['info']; return $result1; } }?> in show.php file <? require_once("xyz.php"); $pen = new book; if($pen->page2(100011)) { session_start(); if (mysql_error()) { print "Database ERROR: " . mysql_error(); } else{ echo "cows"; echo "<br>cows<br>"; echo "my name is'".$_SESSION['info']."'"; echo "my name is'".$_SESSION['FIRST_NAME']."'"; //i have a fied is db named FIRST_NAME } } else{echo "happy";} ?>
×
×
  • 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.