PDA

View Full Version : Need Help Passing array.


harmor19
09-08-2005, 01:02 AM
I am trying to make a mod where you can click on "More Stats" and it opens a new window.

I made the link and put $post['userid'] at the end and I can see that is works in the status bar when I hover over the link.

I used this query but it doesn't work
$getstats = $DB_site->query("SELECT * FROM userfield WHERE userid='".$post['userid']."' ")or die(mysql_error());
$stats= $DB->fetch_array($getstats );

I think I have to use LEFT JOIN but I'm new to that.

What I want to do is pull up userfields from a certain user.

Marco van Herwaarden
09-08-2005, 02:51 AM
I can't answer this without seeing the code for the form that is submitting it (or the link that will open this page). But i guess you are looking for $_POST['userid'].

Make sure however that you protect against insertions, and i am not sure why you are using 'or die'.

Oh and you want to use that fetch_array in a while loop.

harmor19
09-08-2005, 03:11 AM
<a href="http://www.rapinfluence.com/board/showthread.php?p=6#post6" target="_blank">http://www.rapinfluence.com/board/sh....php?p=6#post6</a>

Use the one next to the instant messenger icons.

Marco van Herwaarden
09-08-2005, 03:16 AM
$_POST['bs'] is what you are looking for i guess.

harmor19
09-08-2005, 03:23 AM
Well it was $_GET['bs'] but thanks for telling me to use ['bs'].

Thanks for your help