0

I couldn't register php session from mysql query. Can you tell me what is the correct method to register php session in mysql field. I tried many ways. Still no solution.

$sql=("SELECT email FROM people");

$result=mysql_query($sql);

$email = mysql_fetch_array($result);

echo $email['email'];

//could not register this way 
session_register("$email");
2
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by ryan311
0

$email = mysql_fetch_array($result);

$email1 = $email;

session_register("$email1");

Edited by ryan311: i forgot sorry :)

0

$email = mysql_fetch_array($result);

$email1 = $email;

session_register("$email1");

I got the php error message. I tried same code as given by you. Any advice pls.

Deprecated: Function session_register() is deprecated
0

i mean

session_start("$email1");

Thanks. No error found. but I try to pass the session to next page. I am using

//page2.php 

session_start(); 

//session_start("$email"); 

echo $_SESSION["email"];

How can I retrieve from sessions

Edited by nukabolhi: n/a

0

//page2.php

session_start();

//session_start("$email");

echo $_SESSION["email1"];

you forgot to put 1 after email.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.