Notice: wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.) in /home/****/public_html/wp-includes/functions.php on line 5167
Notice: Undefined offset: 0 in /home/****/public_html/wp-includes/wp-db.php on line 1310
function branch_students(){
$content=\'\';
$content.=\'<div class="container">\';
$content.=\'<h1 align=center class="fofa">Enter Branch</h1>\';
$content.=\'<form method="post" >\';
$content.=\'<div class="b2">\';
$content.=\'<input type="text" name="branch" id="branch" class="box" placeholder="Enter Branch" required */></div>\';
$content.=\'<br>\';
$content.=\'<div>\';
$content.=\'<button type="submit" name="save" class="btn_Register" value="save">Save</button>\';
$content.=\'</div>\';
$content.=\'</form>\';
$content.=\'</div>\';
return $content;
}
this is my first form in this form i creates branches. now i want database of this branch form should be showed in the following table as selection options.
function arsh_forms(){
$content .=\'<div class="col-sm-6">\';
$content .=\'<label class="fofa" style=" font: italic bold 12px/30px Georgia, serif; font-size:26px;color:black;">Select Branch</label>\';
$content .=\'<select name="selectbranch"id="selectbranch" class="form-control"style=" font: italic bold 12px/30px Georgia, serif; font-size:20px;"placeholder="selectbranch"required/>\';
$content .=\'<option value="0" >select branch</option>\';
global $wpdb;
$table_name=$wpdb->prefix.\'arsh_branch\';
$select_branch = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name"));
if(count($select_branch) > 0){
foreach ($select_branch as $key=>$value){
$content .=\'<option value="<?php echo $value->branches; ?>">
<?php echo ucwords($value->branches);?></option>\';
}
}
$content .=\'</select>\';
$content.=\'<div class="col-sm-6">\';
$content .=\'<button type="submit" name="submit" value="Register" style=" width:30%;height:35px;background-color:black;color:white;float:right; margin-top:40px;"
class="bt">Register</button>\';
$content .=\'</div>\';
}
我认为现在这是可以理解的。请问有没有人能帮我?