lost array information?
Posted: Tue Jan 27, 2004 6:20 pm
i think my brain went on vacation and forgot to inform me. i can't find any error here, yet the information in the display side.. the information retrieved from the db, not all of it is not being displayed... the issue here is that it USED to work anf that i know those feilds exist AND have information (from checking the db directly)
for some reason the information fromt he fetch array is blank
any hints as to what i'm doing wrong will be greatly appreciatedthanx in advance, josh
for some reason the information fromt he fetch array is blank
any hints as to what i'm doing wrong will be greatly appreciated
Code: Select all
}else{ # it's ok to let you write a message, or to send it
if(isset($_POST['message'])){ # we're sending a site message
$message=clean($_POST['message']); # get rid of "bad" characters
$sendmsg=mysql_query("INSERT INTO msgs (to_id, from_id, from_un, sent, message) VALUES ('$toid', '$uid', '$un', NOW(), '$message')", $db);
if(mysql_affected_rows($db)){ # it was sent
bgnmsgpg('Site Message Sent');
echo "<p>Message Sent to $to<br />Click <a href="3" onclick="window.close();">here</a> to close this window</p>";
clspg();
}
}else{ # set up the message interface
$msg1=''; $msg2=''; $when='';
if(isset($_GET['mid'])){ # there is a sent message
$mid=$_GET['mid']; # message id number
$frmsginf=mysql_query("SELECT message,from_un,from_id,UNIX_TIMESTAMP(sent) FROM msgs WHERE msg_id='$mid' AND to_id='$toid'", $db); # only the person it's sent TO may see
$msginf=mysql_fetch_array($frmsginf); # message info
$vmsg=mysql_query("UPDATE msgs SET viewed='1' WHERE msg_id='$mid'", $db); # set to viewed
$when="Message Sent At: ".gmdate($utds, ($msginf['UNIX_TIMESTAMP(sent)']+($gmto*60*60))); # when was it sent? (get the unix timestamp of the time from mysql, add the gmt offset, in seconds, and format the way the user wants to see the dates)
$pto=strtolower($msginf['from_un']); # name lowercase for the pictures
$msg1=' <tr><td colspan="5">'.codeparse($msginf['message']).'</td></tr>'; # message to show the user
$msg2="[quote=$to]{$msginf['message']}[/quote]"; # reply box
}
bgnmsgpg('Reading/Sending FYDim'); # start the page
// this heredoc creates the body
echo <<<END
<form action="{$_SERVER['PHP_SELF']}" method="POST" onReset="window.close();">
<input id="to" name="to" type="hidden" value="$to">
$tsnwb1
<tbody>
<tr>
<td rowspan="3" class="smthmb"><a href="profile.php?un={$msginf['from_un']}" target="profile"><img alt="{$msginf
['from_un']}" class="smthmb" src="pic.php?pic=main.$pto.jpg&fn=ltn" /></a></td>
<td colspan="2">Message To/From: <a href="profile.php?un={$msginf['from_un']}" target="profile">$to</a></td>
<td colspan="2"><a href="block.php?pest={$msginf['from_un']}" target="_self">Block User</a></td>
</tr>
<tr>
<td colspan="3">$when</td>
<td ><a href="code.php" target="code">SiteCode</a> On</td>
</tr>
<tr>
<td><input type="submit" value="Send Mail" /></td>
<td><input type="reset" value="Close Window" /></td>
<td colspan="2"><a name="#desire" href="#desire" onclick="window.open('adddesire.php?fun={$msginf['from_un']}&fu
in=$toid', 'desire', 'height=196,width=288');">Add Desire</a></td>
</tr>
$msg1
<tr>
<td colspan="5"><textarea cols="59" id="message" name="message" rows="5">$msg2</textarea></td>
</tr>
</tbody>
</table>
</form>
END;
clspg(); # close the page
}