help on my site? the code just creates errors :/

heres the code:

[php]<?php
function gotome () {
$meurl = ‘http://www.xudda.com/profile.php?id=’. $SESSION_[‘id’] ."";
header( ‘Location: $meurl’);
}
session_start();
//removed the server password and select db stuff…
//
//
$test1= $_GET[“personid”];
$query = “SELECT * from user WHERE id=’$test1’”;
$result= mysql_query($query, $link) or die(mysql_error().’
SQL:’.$query);
if ($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{ //may have to change it, the idea of a “while” loop seems to make me think itll
//be slow when fetching large amounts of variable data
$id2 = $row[‘id’];
$firstname2 = $row[‘firstname’]; //firstname…
$lastname2 = $row[‘lastname’]; //lastname…
$work2 = $row[‘work’]; //occupation…
$email2 = $row[‘email’];
//**EDIT MARCH 2nd 2011 12:31 PM: for some reason after this it will stop loading variables,
// CONTINUED EDIT: nvm its working now. lolwut?
$location2 = $row[‘location’]; //location…
$fmov2 = $row[‘movie’]; //movies…
$fbook2 = $row[‘book’]; //lol.
$fspot2 = $row[‘spot’]; // fav spot
$hmctd2 = $row[‘hmctd’]; //“Hold me Closer Tony Danza” is the variable in the database for the fav motto
$bio = $row[‘BIO’]; //The Bio
$bpost1 = $row[‘bpost1’]; //The First post on a persons /b/oard
$bpost2 = $row[‘bpost2’]; //The Second post on a persons /b/oard
$bpost3 = $row[‘bpost3’]; //The Third post on a persons /b/oard
$bpost4 = $row[‘bpost4’]; //The Fourth post on a persons /b/oard
$bpost5 = $row[‘bpost5’]; //The Fifth post on a persons /b/oard
$bpost6 = $row[‘bpost6’]; //The Fifth post on a persons /b/oard
$_SESSION[‘viewid2’]=$id2;
$_SESSION[‘viewusername’]=$email2;
$_SESSION[‘viewlastname’]=$lastname2;
$_SESSION[‘viewfirstname’]=$firstname2;
$_SESSION[‘viewwork’]=$work2;
$_SESSION[‘viewloc’]=$location2;
$_SESSION[‘viewfmov’]=$fmov2;
$_SESSION[‘viewfbook’]=$fbook2;
$_SESSION[‘viewfspot’]=$fspot2;
$_SESSION[‘viewhmctd’]=$hmctf2;
$_SESSION[‘viewbio’]=$bio;
$_SESSION[‘viewb1’]=$bpost1;
$_SESSION[‘viewb2’]=$bpost2;
$_SESSION[‘viewb3’]=$bpost3;
$_SESSION[‘viewb4’]=$bpost4;
$_SESSION[‘viewb5’]=$bpost5;
$_SESSION[‘viewb6’]=$bpost6;

}
}
?>

a.one:link {color:#ffffff;} a.one:link {color:#ffffff;} a.one:visited {color:#ffffff;} a.two:link {color:#000000;} a.two:link {color:#000000;} a.two:visited {color:#000000;}
<?php session_start(); echo "".$_SESSION['viewfirstname']." ".$_SESSION['viewlastname'];?>'s Profile
h1 {font-size:30px;} h2 {font-size:20px;} #info { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; width:100%; height:100px; border-collapse:collapse; } #info td, #info th { font-size:1em; border:1px solid #98bf21; padding:3px 7px 2px 7px; height:50px; } #info th { font-size:1.1em; text-align:left; padding-top:5px; padding-bottom:4px; background-color:#A7C942; color:#ffffff; } #info tr.alt td { color:#000000; background-color:#EAF2D3; } #b { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; width:100%; height:100px; border-collapse:collapse; } #b td, #b th { font-size:1em; border:1px solid #000000; height:50px; } #b th { font-size:1.1em; text-align:left; padding-top:5px; padding-bottom:4px; background-color:#FFCC66; color:#ffffff; } #b tr.alt td { color:#000000; background-color:#EAF2D3; } a.three:link,a.three:visited { display:block; font-weight:bold; color:#FFFFFF; background-color:#7A991A; width:120px; text-align:center; padding:4px; text-decoration:none; } a.three:hover,a.three:active { background-color:#0000FF; } a.one:link {color:#ffffff;} a.one:link {color:#ffffff;} a.one:visited {color:#ffffff;} a.two:link {color:#000000;} a.two:link {color:#000000;} a.two:visited {color:#000000;}
Nav Bar

Profile Edit my Profile Inbox Connections

<?php session_start(); echo "".$_SESSION['viewfirstname']." ".$_SESSION['viewlastname'];?>


BIO:

<?php session_start(); echo "". $_SESSION['viewbio'] .""?>




INFO:

Work: <?php session_start(); echo "".$_SESSION['viewwork'].""?>
Location: <?php session_start(); echo "".$_SESSION['viewloc'].""?>
Fav Spot: <?php session_start(); echo "".$_SESSION['viewfspot'].""?>
Fav Book: <?php session_start(); echo "".$_SESSION['viewfbook'].""?>
Fav Movie: <?php session_start(); echo "".$_SESSION['viewfmov'].""?>



This Persons /b/OARD:


Posts:

<?php session_start(); echo "".$_SESSION['viewb1'].""?>
<?php session_start(); echo "".$_SESSION['viewb2'].""?>
<?php session_start(); echo "".$_SESSION['viewb3'].""?>
<?php session_start(); echo "".$_SESSION['viewb4'].""?>
<?php session_start(); echo "".$_SESSION['viewb5'].""?>
<?php session_start(); echo "".$_SESSION['viewb6'].""?>

Post something on this person's /b/OARD

Whats up?

Whats up?


Whats up?
&copy 2011 Caleb Roberts
[/php]
must be between head tags, first of all....

Hi there,

It might help if you actually tell us what the errors are and what line is erroring (if the error message(s) tells you that information).

after changing line 12 to look like this
[php]$result= mysql_query($query) or die(mysql_error().’
SQL:’.$query);[/php]
the script was only haulted due to no database. i did pass personid=3 to bypass the error on line 10.

Notice: Undefined index: personid on line 10

aside from this i am unsure as to what other errors there might be.

the error is that all the people from the database are the same, aka id=1 gives the same person as id=10194029210491049019402931029432090129401294094019 (lol)

it only gives the last joining person

Sponsor our Newsletter | Privacy Policy | Terms of Service