Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2009, 12:02 PM
Authorized User
 
Join Date: Aug 2009
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default Member profile advice.....?

Hello again all and thanks for taking the time to read this!

My problem is as follows:
I have a search form which pulls data according to country, state and industry and displays the result with the company name as a link to its profile(member_profile.php). The name of the company shows up and the link works but the member_profile details I cant seem to pull across from the link clicked. (make sense at all?)

The code that shows the list of companies is like this:

Code:
 <?php
session_start();			
include 'dbc.php';

//select which database you want to edit
mysql_select_db("users");
$search=$_POST["search"];

//get the mysql and store them in $result
//change whatevertable to the mysql table you're using
//change whatevercolumn to the column in the table you want to search
$result = mysql_query("SELECT * FROM users WHERE country LIKE '%$country%' AND state LIKE '%$state%' AND industry LIKE '%$industry%' ORDER BY full_name DESC");


//grab all the content
while($r=mysql_fetch_array($result))

{	
   //the format is $variable = $r["nameofmysqlcolumn"];
   //modify these to match your mysql table columns
  
   $full_name=$r["full_name"];
   $id=$r["id"];
   
   echo '<a href="member_profile.php" target="_blank" id=' . $r['id'] . '">'.$r['full_name'].'</a><br />';
   }
  
?>
As you can see it shows retrieves the id and full name and displays the full name as the link to member_profile.php.
The member profile page has the following code:

Code:
<?php
session_start();
require 'dbc.php';
{

$id = $_GET['id'];
$user = mysql_query("SELECT * FROM user WHERE id = '$id'");
$user=mysql_fetch_assoc($user);

}

echo "<h1>User Info</h1>";

echo "<b>Username:".$user['full_name']."<br>";

echo "<br>";
  echo '<form name="backlistfrm" method="post" action="members.php">';
echo '<input type="submit" value="Back to The List">';
echo '</form>';
echo "<br>";

?>
the name does not show up based on that code?

Does anybody have ideas where Im messing up

Thanks again,
Clint
 
Old September 29th, 2009, 04:54 AM
Authorized User
 
Join Date: Aug 2009
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Never mind....thats what I get for working late at night :D
Its working now. Thanks for taking thetime to read it either way





Similar Threads
Thread Thread Starter Forum Replies Last Post
Profile in BLL Faith ASP.NET 2.0 Professional 3 August 18th, 2008 10:57 AM
Profile properties depending on the member type mecca BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 24th, 2007 04:43 PM
'Address' is not a member of 'Profile' FredPi BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 January 30th, 2007 12:48 PM
how to use shoppingcart without profile? hertendreef ASP.NET 2.0 Basics 6 January 11th, 2007 05:16 AM
delete profile ?? n/a Forum and Wrox.com Feedback 6 August 8th, 2003 03:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.