p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > PHP/MySQL > Beginning PHP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 28th, 2009, 01:02 PM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Aug 2009
Posts: 8
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 29th, 2009, 05:54 AM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Aug 2009
Posts: 8
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Profile in BLL Faith ASP.NET 2.0 Professional 3 August 18th, 2008 11: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 05: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 P2P and Wrox.com Feedback 6 August 8th, 2003 04:24 PM



All times are GMT -4. The time now is 12:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc