Jump to content

Recommended Posts

Im trying to print the database information using my session id, on my local machine it works great but when i put it online it does not work at all :(

can someone help me please... it is urgent

<h1><?php print $info['firstname']; ?>'s Account</h1><br> only displays 's Account but no name it seems that the $info['firstname'] is not working

<?php
include('includes/mysql_connect.inc.php');
// start session
session_start();
// check to make sure the session is registered
if(session_is_registered('emailaddress')) {} else { header("Location: login.php"); }
?>
<?php include('includes/header.inc.php'); ?>

<?php
// Collects data from "members" table 
$data = mysql_query("SELECT * FROM members WHERE emailaddress='$emailaddress'") or die(mysql_error());
$info = mysql_fetch_array( $data );
?>

<h1><?php print $info['firstname']; ?>'s Account</h1><br>

Link to comment
https://forums.phpfreaks.com/topic/76922-solved-help-with-printing-session-info/
Share on other sites

echo the query from the php script..

copy and paste it into a query in phpmyadmin.. if this works.. check the selected table (check it twice.. it a common place of error) along with user access right.. if it fails then check the table fields and records

no no,

put this in PMA

SELECT * FROM members WHERE emailaddress='$emailaddress'

replace $emailaddress with a real email (from the database)

 

could you also post the mysql_connect.inc.php script (replace private date with ##'s)

awesome that worked when i changed it to an actual email address

$data = mysql_query("SELECT * FROM members WHERE emailaddress='2fr3sh@gmail.com'") or die(mysql_error());

now what how can i fix it to be dynamic it worked locally? ???

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.