PDA

View Full Version : UPDATED - costum editCP - print_input_row appears empty with images.


Vaupell
02-03-2009, 03:28 PM
Trying to get a Edit box to function..
94000

It shows up fine, but it always show up empty..
94001



print_cp_header("Edit code");

$code=$db->query("SELECT * FROM " . TABLE_PREFIX . "vbinvitationcode WHERE codedbID='".$_GET['id']."'");

<input type='hidden' name='codedbID' value='".$code['codedbID']."'>";
print_form_header('Edit', 'goeditsave');
print_table_header("Edit invitation code");
print_input_row("Invitation Code", 'InvitationCODE', $code['InvitationCODE']);
print_input_row("Put user in Group ID", 'NewusergroupID', $code['NewusergroupID']);
print_submit_row("Save changes", 0);
print_cp_footer();
}

Id is transfered from previous selection, where the user selects EDIT
all works and i get the form, but its empty, fields are empty..

any ideas why nothing shows ?

EDIT : added images, for ilustation

Dismounted
02-04-2009, 05:11 AM
Always clean your variables... Your query will return a result object, not an array as you expect it, use this:
$code = $vbulletin->db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "vbinvitationcode
WHERE codedbID = " . intval($_GET['id']) . "
LIMIT 1
");