Jump to content

whats wrong with this????


zsxdcfv21

Recommended Posts

everytime i visit my link, for example this kind of URL http://www.mywebsitehere.com/app/buyer.php?action=notes&BuyerID=1068

case 'notes':

$q = "
SELECT n.BuyerNoteID,
      n.Note,
      date_format(n.Created, '%d %b %y')  nCreated,
      date_format(n.Created, '%d %b %y') nModified
 
FROM BuyerNote n
JOIN Buyer b
  ON b.BuyerID = n.BuyerID
AND b.BuyerID = '{$_GET['BuyerID']}'
JOIN User u
  ON b.UserID = u.UserID
";
if (!$isAdmin)
$q .= " AND u.UserID = '{$_SESSION['UserID']}' ";

$q .=" ORDER BY n.Created DESC";

$db->execute($q);

if ( true == $db->resultHasRows() ) {
require_once('func.buyernote.php');
$notes = '';
while ( false != ($r = $db->getObject()) ) {
$notes .= makeNote($r->BuyerNoteID, nl2br($r->Note), $r->nCreated, $r->nModified);
}
} else {
$notes = 'No Notes to Display.';
}

$o = $db->executeOrDie("
select concat(Firstname, ' ', Surname) Name
from Buyer
where BuyerID = '{$_GET['BuyerID']}'
");

// alterted this 18 august
if (!$isSubAdmin)
$html->setAction("note_add&BuyerID=".$_GET['BuyerID'], 'Add a Note');
$html->setHeading('View Notes for ' . $o->Name);
$html->bindContent($notes);
$html->useBackButton($_SERVER['PHP_SELF']);
$html->printHTML();
$html->serialise();
break;


... it gives me a blank. no errors or whatsoever, its purely blank. the script for 'func.buyernote.php' are the ff:


<?

function makeNote ($id, $note, $created) {
global $isSubAdmin;
$note = <<<endh
<table class="note">
<tr>
<td valign="top" width="75" class="date"><b>$created</b></td>
<td valign="top" class="text" rowspan="2">$note</td>
</tr>
<tr>
<td valign="bottom">
endh;
if ( ! $isSubAdmin )
{
$note .= <<<endh
<a href="buyer.php?action=note_edit&BuyerNoteID=$id">Edit</a> |
<a href="buyer.php?action=note_remove&BuyerNoteID=$id">Delete</a>
endh;
}
$note .= "</td></tr></table><br>";
return $note;
}

?>


can anyone tell me whats wrong??? =(
Link to comment
https://forums.phpfreaks.com/topic/19103-whats-wrong-with-this/
Share on other sites

Try chnaging this
[code]date_format(n.Created, '%d %b %y')  nCreated,
date_format(n.Created, '%d %b %y') nModified[/code]

to this
[code]date_format(n.Created, '%d %b %y')  as nCreated,
date_format(n.Created, '%d %b %y') as nModified[/code]

I had to do this for a date I was using to format it how i wanted
Link to comment
https://forums.phpfreaks.com/topic/19103-whats-wrong-with-this/#findComment-82693
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.